r - Use nls with fixed parameters? -


i've been trying use nls function fit experimental data model have, expressed function of 3 parameters, let's a, b , c. however, keep b , c fixed, since know true value, , fit parameter a:

nls(formula=pattern~myfunction(a, b, c), start=list(a=estimate_a), control=list(maxiter=50, tol=5e-8, warnonly=t), algorithm="port", weights=sqrt(pattern), na.action=na.exclude, lower=0, upper=1) 

but apparently not work... how can tell r b , c fixed?

a quick solution:

my_new_function <- function(a) myfunction(a, b = b_true, c = c_true) nls(formula = pattern ~ my_new_function(a), start = list(a = estimate_a),      control = list(maxiter = 50, tol = 5e-8, warnonly = true), algorithm = "port",      weights = sqrt(pattern), na.action = na.exclude, lower = 0, upper = 1) 

Comments