[R] Pasting a list of parameters into a function

S Ellison S.Ellison at LGCGroup.com
Thu Jan 24 18:32:58 CET 2013


> I'm trying to iterate model fits while holding one variable 
> (l,a,b or s) constant.  In order to do this, each time I need 
> to re-run the mle2 fit with one variable held constant, 
Have you read the help page closely enough, I wonder?

If I look at the mle2 help page, I see an argument called 'fixed' described as "Named list. Parameter values to keep fixed during optimization."

Looking at the first example, i see an example of that in the line
fit1F <- mle2(LL, fixed=list(xhalf=6))

If I run that, I see mle2 use xhalf as a fixed parameter, iterating only over the remaining parameter, y 

That looks awfully like what you seem to want, with no change to your negative log-likelihood function at all.  

S Ellison


*******************************************************************
This email and any attachments are confidential. Any use...{{dropped:8}}



More information about the R-help mailing list