PecanProject / pecan

The Predictive Ecosystem Analyzer (PEcAn) is an integrated ecological bioinformatics toolbox.
www.pecanproject.org
Other
203 stars 235 forks source link

approx.posterior function fails on BioCro / salix PFT #223

Closed dlebauer closed 6 years ago

dlebauer commented 10 years ago

If I run the meta analysis using this settings file, the approx.posterior function breaks (for cuticular_cond) giving the error:

Error in UseMethod("logLik") : 
  no applicable method for 'logLik' applied to an object of class "NULL"
In addition: There were 32 warnings (use warnings() to see them)
d> traceback()
9: ll(object)
8: AIC.default(x)
7: AIC(x) at approx.posterior.R#89
6: FUN(X[[2L]], ...)
5: lapply(fit, function(x) {
       AIC(x)
   }) at approx.posterior.R#89
4: approx.posterior(trait.mcmc, prior.distns, jagged.data, pft$outdir) at run.meta.analysis.R#109
3: FUN(X[[1L]], ...)
2: lapply(pfts, run.meta.analysis.pft, iterations, dbfiles, dbcon) at run.meta.analysis.R#147
1: run.meta.analysis(pfts = settings$pfts, iterations = settings$meta.analysis$iter, 
       dbfiles = settings$run$dbfiles, database = settings$database$bety)
dlebauer commented 10 years ago

Error likely has something to do with the optimization algorithm used by fitdistr. Since cuticular_cond is in units of umol, the values are ~10^g6

Quick solution is not to evaluate fit of gamma for this trait.

+      if(!trait == 'cuticular_cond'){
+        fit[[5]] <- suppressWarnings(fitdistr(dat, "gamma"))
+      } 
infotroph commented 6 years ago

@dlebauer just found this while reviewing open BioCro issues. Is this problem still active?

dlebauer commented 6 years ago

No this hasn't re-appeared and is almost 4 years old - will close.