[R] model selection with spg and AIC (or, convert list to fitted model object)

Ben Bolker bbolker at gmail.com
Mon Dec 3 04:44:18 CET 2012


Adam Zeilinger <zeil0006 <at> umn.edu> writes:

> 
> Dear R Help,
> 
> I have two nested negative log-likelihood functions that I am optimizing 
> with the spg function [BB package].  I would like to perform model 
> selection on these two objective functions using AIC (and possibly 
> anova() too).  However, the spg() function returns a list and I need a 
> fitted model object for AIC(), ICtab() [bbmle package], or anova().
> 
> How can I perform AIC-based model selection on two spg-optimized 
> objective functions?  Alternatively, how can I convert the list returned 
> by spg into a fitted model object that can be run in AIC, ICtab, or anova?
> 

  I believe you can use spg within mle2 by specifying
optimizer="optimx", method="spg" ... that should give you a fitted
mle2 object that you can work with.

  Alternately, it's just not that hard to compute the AICs yourself ...
or a likelihood ratio test ...

  Ben Bolker




More information about the R-help mailing list