dpritchard / frair

Tools for Functional Response Analysis
8 stars 3 forks source link

Improve fair_compare #23

Open dpritchard opened 8 years ago

dpritchard commented 8 years ago

Currently frair_compare relies on some dodgy logic for applying different options for mle2 for different curves.

if(length(unlist(start))>1){
        try_test <- try(bbmle::mle2(minuslogl=fr_nll_difffunc, <SNIP> optimizer='optim', method='Nelder-Mead'), 
                        silent=TRUE)
    } else {
        try_test <- try(bbmle::mle2(minuslogl=fr_nll_difffunc, <SNIP>, optimizer='optim'), 
                        silent=TRUE)
    }

friar_fitdoesn't rely on this logic, because the relevant fitting is done inside a dedicated *_fit function for that family. Ideally, fair_compare would implement a similar logic.