Displaying 20 results from an estimated 10000 matches similar to: "Error in NLS example in the documentation"
2010 Apr 19
3
nls for piecewise linear regression not converging to least square
Hi R experts,
I'm trying to use nls() for a piecewise linear regression with the first
slope constrained to 0. There are 10 data points and when it does converge
the second slope is almost always over estimated for some reason. I have
many sets of these 10-point datasets that I need to do. The following
segment of code is an example, and sorry for the overly precise numbers,
they are just
2010 Apr 19
2
nls minimum factor error
Hi,
I have a small dataset that I'm fitting a segmented regression using nls on.
I get a step below minimum factor error, which I presume is because residual
sum of square is still "not small enough" when steps in the parameter space
is already below specified/default value. However, when I look at the trace,
the convergence seems to have been reached. I initially thought I might
2008 Sep 02
2
nls.control()
All -
I have data:
TL age
388 4
418 4
438 4
428 5
539 10
432 4
444 7
421 4
438 4
419 4
463 6
423 4
...
[truncated]
and I'm trying to fit a simple Von Bertalanffy growth curve with program:
#Creates a Von Bertalanffy growth model
VonB=nls(TL~Linf*(1-exp(-k*(age-t0))), data=box5.4,
start=list(Linf=1000, k=0.1, t0=0.1), trace=TRUE)
#Scatterplot of the data
plot(TL~age, data=box5.4,
2009 Oct 02
1
nls not accepting control parameter?
Hi
I want to change a control parameter for an nls () as I am getting an error
message "step factor 0.000488281 reduced below 'minFactor' of 0.000976562".
Despite all tries, it seems that the control parameter of the nls, does not
seem to get handed down to the function itself, or the error message is
using a different one.
Below system info and an example highlighting the
2012 Apr 17
3
error using nls with logistic derivative
Hi
I?m trying to fit a nonlinear model to a derivative of the logistic function
y = a/(1+exp((b-x)/c)) (this is the parametrization for the SSlogis function with nls)
The derivative calculated with D function is:
> logis<- expression(a/(1+exp((b-x)/c)))
> D(logis, "x")
a * (exp((b - x)/c) * (1/c))/(1 + exp((b - x)/c))^2
So I enter this expression in the nls function:
2012 Jan 25
1
solving nls
Hi,
I have some data I want to fit with a non-linear function using nls, but it
won't solve.
> regresjon<-nls(lcfu~lN0+log10(1-(1-10^(k*t))^m), data=cfu_data,
> start=(list(lN0 = 7.6, k = -0.08, m = 2)))
Error in nls(lcfu ~ lN0 + log10(1 - (1 - 10^(k * t))^m), data = cfu_data, :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
Tried to increase minFactor
2008 Apr 14
3
Logistic regression
Dear all,
I am trying to fit a non linear regression model to time series data.
If I do this:
reg.logis = nls(myVar~SSlogis(myTime,Asym,xmid,scal))
I get this error message (translated to English from French):
Erreur in nls(y ~ 1/(1 + exp((xmid - x)/scal)), data = xy, start =
list(xmid = aux[1], :
le pas 0.000488281 became inferior to 'minFactor' of 0.000976562
I then tried to set
2007 Apr 15
1
nls.control( ) has no influence on nls( ) !
Dear Friends.
I tried to use nls.control() to change the 'minFactor' in nls( ), but it
does not seem to work.
I used nls( ) function and encountered error message "step factor
0.000488281 reduced below 'minFactor' of 0.000976563". I then tried the
following:
1) Put "nls.control(minFactor = 1/(4096*128))" inside the brackets of nls,
but the same error message
2013 Oct 27
1
nls function error
data(Boston, package='MASS')
y <- Boston$nox
x <- Boston$dis
nls(y~ A + B * exp(C * x), start=list(A=1, B=1, C=1))
Error in nls(y ~ A + B * exp(C * x), start = list(A = 1, B = 1, C = 1), :
step factor 0.000488281 reduced below 'minFactor' of 0.000976562
I don't know how to fix this error. I think my problem is that I set the
wrong start. Could somebody help please?
2002 Apr 23
1
Use of nls command
Hello.
I am trying to do a non-linear fit using the 'nls' command.
The data that I'm using is as follows
pH k
1 3.79 34.21
2 4.14 25.85
3 4.38 20.45
4 4.57 15.61
5 4.74 12.42
6 4.92 9.64
7 5.11 7.30
8 5.35 5.15
9 5.67 3.24
with a transformation of pH to H <- 10^-pH
When using the nls command for a set of parameters - a, b and c, I receive
two sets of errors:
>
2013 Oct 03
2
SSweibull() : problems with step factor and singular gradient
SSweibull() : problems with step factor and singular gradient
Hello
I am working with growth data of ~4000 tree seedlings and trying to fit non-linear Weibull growth curves through the data of each plant. Since they differ a lot in their shape, initial parameters cannot be set for all plants. That’s why I use the self-starting function SSweibull().
However, I often got two error messages:
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 Feb 22
3
problems with nonlinear fits using nls
Hello colleagues,
I am attempting to determine the nonlinear least-squares estimates of
the nonlinear model parameters using nls. I have come across a common
problem that R users have reported when I attempt to fit a particular
3-parameter nonlinear function to my dataset:
Error in nls(r ~ tlm(a, N.fix, k, theta), data = tlm.data, start =
list(a = a.st, :
step factor 0.000488281
2015 Mar 18
1
Help
Hi to All,
I am fitting some models to a data using non linear least square, and
whenever i run the command, parameters value have good convergence but I
get the error in red as shown below. Kindly how can I fix this problem.
Convergence of parameter values
0.2390121 : 0.1952981 0.9999975 1.0000000
0.03716107 : 0.1553976 0.9999910 1.0000000
0.009478433 : 0.2011017 0.9999798 1.0000000
2013 Apr 25
3
nls: example code throws error
Greets,
I'm trying to learn to use nls and was running the example code for an exponential model:
> x <- -(1:100)/10
> y <- 100 + 10 * exp(x / 2) + rnorm(x)/10
> nlmod <- nls(y ~ Const + A * exp(B * x))
Error in B * x : non-numeric argument to binary operator
In addition: Warning message:
In nls(y ~ Const + A * exp(B * x)) :
No starting values specified for some
2011 Mar 28
1
error in nls, step factor reduced below minFactor
Hello,
I've seen various threads on people reporting:
step factor 0.000488281 reduced below `minFactor' of 0.000976563
While I know how to set the minFactor, what I'd like to have happen is for nls to return to me, the last or closest fitted parameters before it errors out. In other words, so I don't get convergence, I'd still like to acquire the values of the parameters
2003 Aug 28
3
(no subject)
Dear All,
A couple of questions about the nls package.
1. I'm trying to run a nonlinear least squares
regression but the routine gives me the following
error message:
step factor 0.000488281 reduced below `minFactor' of
0.000976563
even though I previously wrote the following command:
nls.control(minFactor = 1/4096), which should set the
minFactor to a lower level than the default
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]
2008 Apr 10
1
(no subject)
Subject: nls, step factor 0.000488281 reduced below 'minFactor' of
0.000976563
Hi there,
I'm trying to conduct nls regression using roughly the below code:
nls1 <- nls(y ~ a*(1-exp(-b*x^c)), start=list(a=a1,b=b1,c=c1))
I checked my start values by plotting the relationship etc. but I kept
getting an error message saying maximum iterations exceeded. I have
tried changing these
2006 Aug 04
1
gnlsControl
When I run gnls I get the error:
Error in nls(y ~ cbind(1, 1/(1 + exp((xmid - x)/exp(lscal)))), data = xy, :
step factor 0.000488281 reduced below 'minFactor' of 0.000976563
My first thought was to decrease minFactor but gnlsControl does not contain
minFactor nor nlsMinFactor (see below). It does however contain nlsMaxIter
and nlsTol which I assume are the analogs of