Reply to self: > I am having a hard time fitting a gauss beam using R. In > gnutplot I did something like > > $ w(z) = w0 * sqrt(1+(z/z0)**2) > $ fit w(z) 'before_eom.txt' using 1:2 via w0, z0 > > to obtain w0 and z0. Now I want to do the same in R. I > tried a linear model like this (r = radius, z =
This works fine: data <- read.table ("nach_eom.tab", header=T) M <- 1.1 nls (major ~ M*w0*sqrt(1+(d/z0)^2), data = data, start = list(w0 = 460, z0=0.02)) ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.