On Sat, 30 Dec 2000, Ott Toomet wrote:> > 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 don't think that will do what you want (: is of higher precedence than +) In general just use indexing, which is very powerful in R. So you can have pre-computed index masks, and say start[p1] <- sigma; start[p1] <- beta ... call optim, and in your callback have sigma <- param[p1]; beta <- param[p2] ... -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello, I wonder if generalized additive model (gam) capability will be available in R sooner or later? Anybody know about any ongoing project or plans on this? Thanks! Sungil -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._