[R] Substitute initial guesses of parameters in a function

philippe massicotte pmassicotte at hotmail.com
Wed Dec 3 13:37:56 CET 2014


Hi everyone, I have a formula like this:

f <- as.formula(y ~ p0a * exp(-0.5 * ((x - p1a)/p2a)^2))

I would like to "dynamically" provide starting values for p0a, p1a, p2a. Is there a way to do it?

#Params estimates
p <- c(12, 10, 1)

# This is where I have difficulties
mystart <- substitute(...)

nls(formula = f, start = mystart)

Regards,
Philippe
 		 	   		  
	[[alternative HTML version deleted]]



More information about the R-help mailing list