[R] extracting parameters from vector

Ott Toomet ecomus51 at oecon.au.dk
Sat Dec 30 12:30:31 CET 2000


Dear everybody!

Minimization algorithms usually assume the parameters are in the form of a single
vector. When calculating target function, e.g. log-likelihood, it is much more
pleasant to extract the vector into separate parameters and program the loglik
using them directly. Are ther any more intelligent ways to do that than just
write
 sigma <- param[1]
 beta <- param[1:1+N]
 ...

I know in GAUSS there is something similar to left-hand functions, i.e. you
can write
 {sigma, beta, ...}= param;
(Sorry, i do not know GAUSS well, so I am not quite sure).

Perhaps it could be handled with lists somehow but I do not want to change the
assumption -- data are in a vector --, used by most minimization algorithms.



Thanks in advance

Ott Toomet

And a happy new year, BTW.
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list