Displaying 20 results from an estimated 3000 matches similar to: "question about non-linear least squares in R"
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
2009 Jul 12
2
Nonlinear Least Squares nls() programming help
Hi, I am trying to use the nls() function to closely approximate a vector of
values, colC and I'm running into trouble.  I am not sure how if I am asking
the program to do what I think its doing, because the same minimization in
Excel's Solver does not run into problems.  If anyone can tell me what is
going wrong, and why I'm getting a singular convergence(7) error, please
tell me.  I
2013 May 28
6
Ocultar componentes de una lista
Saludos a todos,
 
Quisiera saber como ocultar algunos componentes de una lista para que cuando crees una funcion solo se muestre una parte de esa lista, y que al resto tengas acceso cuando descompongas ese objeto, por ejemplo:
 
Tengo la siguiente data:
 
data=data.frame(Samples=1:10,Sobs=c(12.6,22.4,27.4,30.5,32.5,34.3,36,37.4,38.9,39.9))
 
Cuando uso la funcion nls:
 
A <-
2005 Jan 06
1
nls - convergence problem
Dear list,
I do have a problem with nls. I use the following data:
>test
    time  conc dose
   0.50  5.40    1
   0.75 11.10    1
   1.00  8.40    1
   1.25 13.80    1
   1.50 15.50    1
   1.75 18.00    1
   2.00 17.00    1
   2.50 13.90    1
   3.00 11.20    1
  3.50  9.90    1
  4.00  4.70    1
  5.00  5.00    1
  6.00  1.90    1
  7.00  1.90    1
  9.00  1.10    1
12.00  0.95    1
14.00 
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
2007 Sep 04
1
Help: how can i build a constrained non-linear model?
Dear
I have a data.frame, and want to fit a constrained non-linear model:
data:
x
y
-0.08
20.815
-0.065
19.8128
-0.05
19.1824
-0.03
18.7346
-0.015
18.3129
0.015
18.0269
0.03
18.4715
0.05
18.9517
0.065
19.4184
0.08
20.146
0
18.2947
model:
y~exp(a)*(x-m)^4+exp(b)*(x-m)^2+const
 
I try to use nls() and set start=list(a=1,b=1,c=1,m=1), but which always give me a error message that
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:
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
2009 Jul 09
1
nls, reach limit bounds
Hi,
I am trying to fit a 4p logistic to this data, using nls function. The function didn't freely converge; however, it converged if I put a lower and an upper bound (in algorithm port). Also, the b1.A parameter always takes value of the upper bound, which is very strange. Has anyone experienced about non-convergent of nls and how to deal with this kind of problem?
Thank you very much.
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
2013 May 28
3
Ocultar componentes de una lista
Hola Javier,
 
Creo que comprendio mal mi pregunta, quiero saber como ocultar algunos componentes de una lista producida por una funcion que uno crea, pero que solo esten ocultos y que pueda tener acceso a esos componentes cuando uso la funcion "str", la cual despliega todos los componentes de la lista. Además como hacer para que salga ordenado o de una forma preferida los componentes
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
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
2004 Jan 14
2
Generalized least squares using "gnls" function
Hi:
I have data from an assay in the form of two vectors, one is response 
and the other is a predictor. When I attempt to fit a 5 parameter 
logistic model with "nls", I get converged parameter estimates. I also 
get the same answers with "gnls" without specifying the "weights" 
argument.
However, when I attempt to use the "gnls" function and try to
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
2009 Jul 20
1
Argument problem in function wrapper
Dear all,
we are writing a wrapper for the nls function in library stats. We are
having a problem with one of the arguments (weightsArgument) which seems not
to reach nls even if we explicitly assign it in the function call. We are
attaching the simplest code reproducing the error and the output calling the
wrapper and calling nls directly. We are using R 2.9.0
library(stats)
wrappernls <-
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
2013 May 28
3
Ocultar componentes de una lista
Hola Eva,
 
Gracias por la respuesta fue de mucha ayuda. Lo que me gustaria saber es por que solo algunas funciones que usan el metodo S3 son visibles en su estructura con la funcion "body". Por ejemplo si coloco
 
body(print.ts)
 
Me va a salir la estructura de esa funcion, sin embargo si coloco
 
body(print.nls)
 
Me sale el siguiente mensaje :Error in body(print.nls) :
2004 Jan 22
4
Fitting compartmental model with nls and lsoda?
Dear Colleagues,
Our group is also working on implementing the use of R for pharmacokinetic compartmental analysis. Perhaps I have missed something, but
> fit <- nls(noisy ~ lsoda(xstart, time, one.compartment.model, c(K1=0.5, k2=0.5)),
+            data=C1.lsoda,
+            start=list(K1=0.3, k2=0.7),
+            trace=T
+            )
Error in eval(as.name(varName), data) : Object
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