Prof. John C Nash
2010-Jun-25 12:55 UTC
[R] Optimizing given two vectors of data (confusedSoul)
> I am trying to estimate an Arrhenius-exponential model in R. I have one > vector of data containing failure times, and another containing > corresponding temperatures. I am trying to optimize a maximum likelihood > function given BOTH these vectors. However, the optim command takes only > one such vector parameter. > > How can I pass both vectors into the function?You need to combine your vectors params<-c(vecone, vectwo) Inside your objective function, you will need to split them out again. However, I have some suspicions that you are referring to the DATA for the function rather than the parameters that are being optimized. The data goes into the '...' arguments to optim and other optimization tools. JN