similar to: nls - find good starting values

Displaying 20 results from an estimated 10000 matches similar to: "nls - find good starting values"

2006 Sep 29
1
linear gradient in nls
Hello, I hope this doesn't turn into a statistics question but here I go. I am using the nls function with a Gaussian distribution, see coding below. When I run the nls I get an error back saying that I have a linear gradient. I then, of course am unable to do anything else. The data that I am using are intensity values from some mass spectrometry data. Is there something I can
2011 Jun 10
2
Plotting NLS profiles
Hello list, I'm trying to plot nls profiles, but the plot.profile.nls function in R doesn't seem to accept any plot.default variables. Specifically, I'd like to be able to change the x-axis title and the colors to black and white. Has anyone had any luck with this? If not, is there a way to override to plotting colors, perhaps in par()? Thanks, Sam fm1 <- nls(demand ~
2010 Jan 13
1
Problem fitting a non-linear regression model with nls
Hi, I'm trying to make a regression of the form : formula <- y ~ Asym_inf + Asym_sup * ( (1 / (1 + (n1 * (exp( (tmid1-x) / scal1) )^(1/n1) ) ) ) - (1 / (1 + (n2 * (exp( (tmid2-x) / scal2) )^(1/n2) ) ) ) ) which is a sum of the generalized logistic model proposed by richards. with data such as these: x <- c(88,113,128,143,157,172,184,198,210,226,240,249,263,284,302,340) y <-
2005 Jun 21
2
nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting
Hello, i have a problem with the function nls(). This are my data in "k": V1 V2 [1,] 0 0.367 [2,] 85 0.296 [3,] 122 0.260 [4,] 192 0.244 [5,] 275 0.175 [6,] 421 0.140 [7,] 603 0.093 [8,] 831 0.068 [9,] 1140 0.043 With the nls()-function i want to fit following formula whereas a,b, and c are variables: y~1/(a*x^2+b*x+c) With the standardalgorithm
2006 May 23
2
nls: formula error?
So thanks for the help, I have a matrix (AB) which in the first column has my bin numbers so -4 - +4 in 0.1 bin units. Then I have in the second column the frequency from some data. I have plotted them and they look roughly Gaussian. So I want to fit them/ find/optimize "mu", "sigma", and "A". So I call the nls function : nls_AB <- nls(x ~ (A/sig*sqrt(2*pi))*
2011 Feb 15
2
"Error : singular gradient matrix at initial parameters estimates"
Dear all, I am a fresh user of R and I already face to problems that I don't understand. In the use of the function nls(), I systematically have an error message : "Singular gradient matrix at initial parameters estimates". I tried to use nls() on a set of data that I subseted from a bigger matrix data. I wish to fit a gaussian on these points (spectrum) and draw this fit on the
2012 Aug 14
1
bootstrapped CI for nonlinear models using nlsBoot from nlstools
Hi all I?m trying to get confidence intervals for parameters from nls modeling. I fitted a nls model to the following variables: > x [1] 2 1 1 5 4 6 13 11 13 101 101 101 > y [1] 1.281055090 1.563609934 0.001570796 2.291579783 0.841891853 [6] 6.553951324 14.243274230 14.519899320 15.066473610 21.728809880 [11] 18.553054450 23.722637370 The model fitted was:
2023 Aug 20
1
Determining Starting Values for Model Parameters in Nonlinear Regression
The cautions people have given about starting values are worth heeding. That nlxb() does well in many cases is useful, but not foolproof. And John Fox has shown that the problem can be tackled very simply too. Best, JN On 2023-08-19 18:42, Paul Bernal wrote: > Thank you so much Dr. Nash, I truly appreciate your kind and valuable contribution. > > Cheers, > Paul > > El El
2006 Aug 25
4
fitting a gaussian to some x,y data
I apologize if this is redundant. I've been Googling, searching the archive and reading the help all morning and I am not getting closer to my goal. I have a series of data( xi, yi). It is not evenly sampled and it is messy (meaning that there is a lot of scatter in the data). I want to fit a normal distribution (i.e. a gaussian) to the data in order to find the center. (The data
2004 Jun 03
5
Confidence intervals for predicted values in nls
Dear all I have tried to estimate the confidence intervals for predicted values of a nonlinear model fitted with nls. The function predict gives the predicted values and the lower and upper limits of the prediction, when the class of the object is lm or glm. When the object is derived from nls, the function predict (or predict.nls) gives only the predicted values. The se.fit and interval aguments
2012 Jun 04
2
Non-linear curve fitting (nls): starting point and quality of fit
Hi all, Like a lot of people I noticed that I get different results when I use nls in R compared to the exponential fit in excel. A bit annoying because often the R^2 is higher in excel but when I'm reading the different topics on this forum I kind of understand that using R is better than excel? (I don't really understand how the difference occurs, but I understand that there is a
2006 Sep 18
1
non linear modelling with nls: starting values
Hi, I'm trying to fit the following model to data using 'nls': y = alpha_1 * beta_1 * exp(-beta_1 * x) + alpha_2 * beta_2 * exp(-beta_2 * x) and the call I've been using is: nls(y ~ alpha_1 * beta_1 * exp(-beta_1 * x) + alpha_2 * beta_2 * exp(-beta_2 * x), start=list(alpha_1=4, alpha_2=2, beta_1=3.5, beta_2=2.5), trace=TRUE, control=nls.control(maxiter =
2007 Sep 05
3
'singular gradient matrix’ when using nls() and how to make the program skip nls( ) and run on
Dear friends. I use nls() and encounter the following puzzling problem: I have a function f(a,b,c,x), I have a data vector of x and a vectory y of realized value of f. Case1 I tried to estimate c with (a=0.3, b=0.5) fixed: nls(y~f(a,b,c,x), control=list(maxiter = 100000, minFactor=0.5 ^2048),start=list(c=0.5)). The error message is: "number of iterations exceeded maximum of
2012 Jan 03
1
nls and rbinom function: step factor 0.000488281 reduced below 'minFactor' of 0.000976562
I  am trying to learn nls using a simple simulation. I assumed that the binomial prob varies linearly as 0.2 + 0.3*x in  x {0,1}, and the objective is to recover the known parameters a=0.2, b=0.3 ..data frame d has 1000 rows... d$x<-runif(0,1)               d$y<-rbinom(1000,1,0.2+0.3*d$x)  table(d$y,cut(d$x,breaks=5));   (-0.000585,0.199] (0.199,0.399] (0.399,0.599] (0.599,0.799]
2006 May 21
2
nls & fitting
Dear All, I may look ridiculous, but I am puzzled at the behavior of the nls with a fitting I am currently dealing with. My data are: x N 1 346.4102 145.428256 2 447.2136 169.530634 3 570.0877 144.081627 4 721.1103 106.363316 5 894.4272 130.390552 6 1264.9111 36.727069 7 1788.8544 52.848587 8 2449.4897 25.128742 9 3464.1016 7.531766 10 4472.1360 8.827367 11
2012 Jul 11
2
nls problem: singular gradient
Why fails nls with "singular gradient" here? I post a minimal example on the bottom and would be very happy if someone could help me. Kind regards, ########### # define some constants smallc <- 0.0001 t <- seq(0,1,0.001) t0 <- 0.5 tau1 <- 0.02 # generate yy(t) yy <- 1/2 * ( 1- tanh((t - t0)/smallc) * exp(-t / tau1) ) + rnorm(length(t))*0.01 # show the curve
2008 May 23
3
nls diagnostics?
Hi, All: What tools exist for diagnosing singular gradient problems with 'nls'? Consider the following toy example: DF1 <- data.frame(y=1:9, one=rep(1,9)) nlsToyProblem <- nls(y~(a+2*b)*one, DF1, start=list(a=1, b=1), control=nls.control(warnOnly=TRUE)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial
2011 Mar 02
1
power regression: which package?
Dear R users and R friends, I have a little problem... I don't know anymore which package to use if I want to perform a power regression analysis. To be clear, I want to fit a regression model like this: fit <- ....(y ~ a * x ^ b + c) where a, b and c are coefficients of the model. The R Site does not have the answer I want... Thanks in advance and with kind regards, David
2010 Apr 28
1
NLS "Singular Gradient" Error
Hello, I am trying to model a type II functional response of number of prey eaten (Ne) against number supplied (No) with a non-linear least squares regression (nls). I am using a modification of Holling's (1959) disc equation to account for non-replacement of prey; Ne=No{1-exp[a(bNe-T)]} where a is the attack rate, b is the handling time, and T is the experimental period. My script is as
2013 Mar 14
2
question about nls
Hi,all: I met a problem of nls. My data: x y 60 0.8 80 6.5 100 20.5 120 45.9 I want to fit exp curve of data. My code: > nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1)) Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates I can't find out the reason for the error. Any suggesions are welcome. Many thanks. [[alternative HTML