[R] Model Formulae Evaluation

albeam beam.andrew at gmail.com
Mon Jun 20 15:08:51 CEST 2011


Please allow me to clarify my original question. What I really need to be
able to do it is to take arbitrary functions and evaluate them for arbitrary
parameter values. I'm doing the optimization myself, so I need to be able to
take a user's function and evaluate them at the current parameter values
during my optimization process. So it would look something like this:

opt.fun <- function(user.formula, param.values)
{
    #--- I would do some optimization here ---#

    fitted.values <- eval.fun(user.formula, param.values) ##<---- this is
what I need
}

Where fitted.values is a vector of the same size as the x-values in
user.formula. nls() does this somehow. I could do this easily myself if I
have the user pass the formula in reverse polish notation, but I was hoping
there was a more canonical was to do this in R.

--
View this message in context: http://r.789695.n4.nabble.com/Model-Formulae-Evaluation-tp3610328p3611329.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list