Displaying 20 results from an estimated 11000 matches similar to: "Using the nls package"
2005 Jun 02
1
nls.control: increasing number of iterations
Hello,
I'm using the nls function and would like to increase the number of
iterations. According to the documentation as well as other postings on
R-help, I've tried to do this using the "control" argument:
nls(y ~ SSfpl(x, A, B, xmid, scal), data=my.data,
control=nls.control(maxiter=200))
but no matter how much I increase "maxiter", I get the following error
2006 Aug 15
2
nls convergence problem
I'm having problems getting nls to agree that convergence has occurred in a
toy problem.
nls.out never gets defined when there is an error in nls. Reaching the
maximum number of iterations is alway an error, so nls.out never gets
defined when the maximum number of iterations is reched.
>From ?nls.control:
tol: A positive numeric value specifying the tolerance level for
the
2005 Oct 21
1
change maxiter for nls
I typed the following commands but it still use maxiter=50 after the 2nd command:
nls.control(maxiter = 1000)
nls(......)
Thanks!
---------------------------------
[[alternative HTML version deleted]]
2013 Jan 04
2
(no subject)
Hi,
I am using the nls function and it stops because the number of iterations
exceeded 50, but i used the nls.control argument to allow for 500
iterations. Do you have any idea why it's not working?
fm1 <- nls(npe ~ SSgompertz(npo, Asym, b2, b3),
data=f,control=nls.control(maxiter=500))
Error in nls(y ~ exp(-b2 * b3^x), data = xy, algorithm = "plinear", start =
c(b2 =
2009 Feb 10
2
plotting the result of a nonlinear regression
Hello,
to plot the result of a singular non linear regression (using nls) I usually use the function plotfit, for example:
r.PTG.V<-nls(PTG.P~ fz1(Portata, a,b), data=dati, start=list(a=10, b=10), nls.control(maxiter=200), algorithm='port',
trace=TRUE, na.action=na.omit, lower=list(a=0, b=10), upper=list(a=100, b=100))
plotfit(r.PTG.V)
I tried to use the function plotfit on the
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
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
2006 Sep 15
1
Formula aruguments with NLS and model.frame()
I could use some help understanding how nls parses the formula argument
to a model.frame and estimates the model. I am trying to utilize the
functionality of the nls formula argument to modify garchFit() to handle
other variables in the mean equation besides just an arma(u,v)
specification.
My nonlinear model is
y<-nls(t~a*sin(w*2*pi/365*id+p)+b*id+int,data=t1,
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 <-
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
2007 Apr 16
1
nls with algorithm = "port", starting values
The documentation for nls says the following about the starting values:
start: a named list or named numeric vector of starting estimates.
Since R 2.4.0, when 'start' is missing, a very cheap guess
for 'start' is tried (if 'algorithm != "plinear"').
It may be a good idea to document that when algorithm = "port", if start
is a named
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
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 <-
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 Mar 12
3
avoiding termination of nls given convergence failure
Hello. I have a script in which I repeatedly fit a nonlinear regression to
a series of data sets using nls and the port algorithm from within a loop.
The general structure of the loop is:
for(i in 1:n){
… extract relevant vectors of dependent and independent variables …
… estimate starting values for Amax and Q.LCP…
2008 Aug 11
3
Peoblem with nls and try
Hello,
I can`t figure out how can increase the velocity of the fitting data by nls.
I have a long data .csv
I want to read evry time the first colunm to the other colunm and analisy with thata tools
setwd("C:/dati")
a<-read.table("Normalizzazione.csv", sep=",", dec=".", header=F)
for (i in 1:dim(a[[2]]]) {
#preparazione dati da analizzare
2000 Jan 06
1
nlme
Among others, datam contains the columns: logconc, tm, dose, subj, bilirubin.
None of these are factor variables.
The following compartment models work (the first still has not
converged after 100 interations):
res1 <- nlme(logconc~p2+p3+log(dose/(exp(p1)-exp(p2))*
(exp(-exp(p2)*tm)-exp(-exp(p1)*tm))),start=list(fixed=c(5,-2,-0.1)),
fixed=list(p1+p2+p3~1),control=list(maxIter=100),
2007 Sep 05
2
question about non-linear least squares in R
Hi, everyone,
My question is: It's not every time that you can get a converged
result from the nls function. Is there any solution for me to get a
reasonable result? For example:
x <- c(-0.06,-0.04,-0.025,-0.015,-0.005,0.005,0.015,0.025,0.04,0.06)
y <-
c(1866760,1457870,1314960,1250560,1184850,1144920,1158850,1199910,1263850,1452520)
fitOup<- nls(y ~ constant + A*(x-MA)^4 +
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
2012 Jun 05
1
- help with the predict function
Hi all,
I would like to predict some values for an nls regression function
(functional response model Rogers type II). This is an asymptotic function
of which I would like to predict the asymptotic value
I estimated the paramters with nls, but can't seem to get predictions for
values of m choice......
This is my script:
RogersII_N <-