Displaying 20 results from an estimated 38 matches for "warnonly".
2007 Apr 16
1
nls with algorithm = "port", starting values
...t;- expsum + max(expsum) *.001 * rnorm(100)
expsum.df <-data.frame(expsumNoisy)
## estimate decay rates, amplitudes with default Gauss-Newton
summary (nls(expsumNoisy ~ getExpmat(k, 1:100) %*% sp, expsum.df, start =
list(k = c(.6,.02), sp = c(1,2)), trace=TRUE, control =
nls.control(maxiter=20,
warnOnly = TRUE)))
## won't work with port
summary (nls(expsumNoisy ~ getExpmat(k, 1:100) %*% sp, expsum.df, start =
list(k = c(.6,.02), sp = c(1,2)), algorithm = "port",
trace=TRUE, control = nls.control(maxiter=20,
warnOnly = TRUE)))
2010 Apr 19
2
nls minimum factor error
...7,
10.740636, 11.246827,17.022761, 21.430386)
x2<-c(25.0, 29.3, 33.8, 38.3, 42.8, 47.2, 51.6, 55.8, 60.4, 64.9)
dat <- data.frame(x2,y2)
nlmod <- nls(y2 ~ ifelse(x2 < xint+(yint/slp), yint, yint +
(x2-(xint+(yint/slp)))*slp),
data=dat, control=list(minFactor=1e-5,maxiter=500,warnOnly=T),
start=list(xint=40.49782, yint=1.013981, slp=0.8547828),
na.action=na.omit, trace=T)
##plotting the function
plot(dat$x2,dat$y2)
segments(x0=0, x1=coef(nlmod)[1]+coef(nlmod)[2]*coef(nlmod)[3],
y0=coef(nlmod)[2], y1=coef(nlmod)[2])
segments(x0=coef(nlmod)...
2009 Dec 01
2
Starting estimates for nls Exponential Fit
Hello everyone,
I have come across a bit of an odd problem: I am currently analysing data
PCR reaction data of which part is behaving exponential. I would like to fit
the exponential part to the following:
y0 + alpha * E^t
In which Y0 is the groundphase, alpha a fluorescence factor, E the
efficiency of the reaction & t is time (in cycles)
I can get this to work for most of my reactions,
2010 Apr 19
3
nls for piecewise linear regression not converging to least square
...6392, 36.39401717, 32.43620195, 44.77442277)
x1<-c(24.6, 28.9, 33.2, 37.6, 42.0, 46.4, 50.9, 55.3, 59.8, 64.3)
dat <- data.frame(x1,y1)
nlmod <- nls(y1 ~ ifelse(x1 < xint+(yint/slp), yint, yint +
(x1-(xint+(yint/slp)))*slp),
data=dat, control=list(minFactor=1e-5,maxiter=500,warnOnly=T),
start=list(xint=39.27464924, yint=0.09795576, slp=2.15061064),
na.action=na.omit, trace=T)
##plotting the function
plot(dat$x1,dat$y1)
segments(x0=0, x1=coef(nlmod)[1]+coef(nlmod)[2]*coef(nlmod)[3],
y0=coef(nlmod)[2], y1=coef(nlmod)[2])
segments(x0=coef(nlmo...
2010 Nov 08
1
try (nls stops unexpectedly because of chol2inv error
...rnal call (internal to nls) of the chol2inv fails.
============================================
Error in chol2inv(object$m$Rmat()) :
element (2, 2) is zero, so the inverse cannot be computed
In addition: Warning messages:
1: In nls(myModel.nlm, fData, start = initialValues, control =
nls.control(warnOnly = TRUE), :
number of iterations exceeded maximum of 50
2: In nls(myModel.nlm, fData, start = initialValues, control =
nls.control(warnOnly = TRUE), :
singular gradient
===========================================================
Any suggestions on how to prevent chol2inv from breaking my simu...
2009 Feb 10
2
plotting the result of a nonlinear regression
...lotfit(r.PTG.V)
I tried to use the function plotfit on the result of the following for loop but I got an error message:
for (i in 1:length(formList))
{
resultList[[i]] <- nls(formList[[i]], data=subset(dati, Fiume=="Laveggio"), start=startList7[[i]],
nls.control(maxiter=1000, warnOnly=TRUE), algorithm='port', na.action=na.omit,lower=lowerList7[[i]],
upper=upperList7[[i]])
}
plotfit(resultList[[1]]
"Error in diff(as.numeric(y[ord])) :
(list) object cannot be coerced to type 'double'"
Could somebody tell me what this error means? how can I fix t...
2010 Aug 13
2
Unable to retrieve residual sum of squares from nls output
...+ PAMPLITUDE * cos(2 * pi * (NEWX - POFFSET)/PERIOD), start = list(PMESOR = MESOR, PAMPLITUDE = AMPLITUDE, ...
> $ dataClasses: Named chr "numeric"
> ..- attr(*, "names")= chr "NEWX"
> $ control :List of 2
> ..$ maxiter : num 1000
> ..$ warnOnly: logi TRUE
> - attr(*, "class")= chr "nls"
However, none of these elements appears to contain the residual sum of squares.
Help! Thanks.
Dennis
Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessTha...
2011 Jun 15
1
Print the summary of a model to file
...68e-05, 0.412938194338572,
3.32626693693668e-05, 0.0441665508678859, 2.86654588531843,
0.412938194338572, 2.86654588531843, 473.324480704723)
nls(formula = wcorr ~ (Y0 + a * exp(m1 * -dist/100)), start = pa1, control
= list(maxiter = 1000, tol = 1e-05, minFactor = 0.0009765625, printEval =
FALSE, warnOnly = TRUE), algorithm = "default", trace = FALSE)
list(isConv = TRUE, finIter = 7, finTol = 4.21396379219722e-06, stopCode =
0, stopMessage = "converged")
list(maxiter = 1000, warnOnly = TRUE)
NULL
c(-0.00018212632256334, 0.166967461792613, 10.8045839935834,
0.0002886078864...
2010 Apr 06
1
estimating the starting value within a ODE using nls and lsoda
...ta$noisy[1:4]), X=0)
# inital fit of nls
fit.rk4 <- nls(noisy ~ rk4(xstart.est, time, minmod, c(p1=p1, p2=p2, p3=p3))[,2],
data=sim.data,
start=list(p1=0.025, p2=0.02, p3=0.00004),
trace=F,
control=list(tol=1e-4, minFactor=1/1024/1024, warnOnly=T),
weight=(1/(G*0.015))*Weight
)
# define deviance function to optimize
DevFunc <- function(p4) {
fit.rk4 <- nls(noisy ~ rk4(c(G=p4, X=0), time, minmod, c(p1=p1, p2=p2, p3=p3))[,2],
data=sim.data,
start=list(p1=summ...
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
2012 Dec 16
1
nls for sum of exponentials
..., upper=c(10e7, 100, 300,100, 300
), control=list(trace=FALSE))
par2 <- fm6$optim$bestmem
names(par2) <- c("c", "A", "n1", "B", "n2")
fit2 <- nls(wcorr ~ (c + A*exp(n1 * -dist) + B*exp(n2 * -dist)),
start=par2,control
=list(maxiter=1000, warnOnly=TRUE))
However, I keep getting the following error -
Error in numericDeriv(form[[3L]], names(ind), env) :
Missing value or an infinity produced when evaluating the model
OR
In nls(wcorr ~ (c + A * exp(n1 * -dist) + B * exp(n2 * -dist)), :
singular gradient
Can anyone suggest how to res...
2009 Jul 09
1
nls, reach limit bounds
...2.7019079 1.04921802
6 3.0679585 1.60745502
9 0.9436973 -0.31875876
10 1.2201133 -0.21467016
11 1.6470043 0.06069784
12 2.2090048 0.54032947
13 2.6864857 1.04921802
14 3.0673523 1.60745502
new.cont=nls.control(maxiter = 10000, tol = 1e-05, minFactor = 1e-08,
printEval = FALSE, warnOnly = FALSE)
b0.A=.9*min(DAT$y)
b1.A=1.1*max(DAT$y)-b0.A
b2.A=-1*mean(DAT$x)
b3.A=1
b0.A
b1.A
b2.A
b3.A
nls.mdl.A=nls(y~b0 + b1/(1+exp(-b2-b3*x)),data=DAT,start = list(b0=b0.A, b1=b1.A, b2=b2.A, b3=b3.A), lower=-10, upper=10, algorithm="port",trace=T,control=new.cont)
##################...
2013 May 28
6
Ocultar componentes de una lista
...ontrol = structure(list(maxiter = 50, tol = 1e-05, ...
$ dataClasses: Named chr "numeric"
..- attr(*, "names")= chr "Samples"
$ control :List of 5
..$ maxiter : num 50
..$ tol : num 1e-05
..$ minFactor: num 0.000977
..$ printEval: logi FALSE
..$ warnOnly : logi FALSE
- attr(*, "class")= chr "nls"
Como se observa muchos de estos elmentos no son mostrados en el resultado de la funcion a menos que se use la funcion "str"
, quisiera saber como hacer esto, ocultar algunos elementos de una lista producida por una funci...
2011 Oct 12
2
Nonlinear regression aborting due to error
Colleagues,
I am fitting an Emax model using nls. The code is:
START <- list(EMAX=INITEMAX, EFFECT=INITEFFECT, C50=INITC50)
CONTROL <- list(maxiter=1000, warnOnly=T)
#FORMULA <- as.formula(YVAR ~ EMAX - EFFECT * XVAR^GAMMA / (XVAR^GAMMA + C50^GAMMA)) ## alternate version of formula
FORMULA <- as.formula(YVAR ~ EMAX - EFFECT / (1 + (C50/XVAR)^GAMMA))
FIT <- nls(FORMULA, start=START, control=CONTROL, trace=T)
If GAMMA equals 10-80, nls conver...
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 parameter estimates
This example is obviously stupid, but other singular gradient
problems are not so obvious.
If we transfer this problem to 'optim', we can get diagnostics
from an ei...
2011 Jun 18
2
different results from nls in 2.10.1 and 2.11.1
...)*sin(theta0) ) * exp(
kappa*cos(theta)*cos(theta0) )
}
nls(dens ~ FisherAvgdPdf(theta,theta0,kappa),
data = data.frame( theta=acos(h$mids), dens=h$density ),
start=c( theta0=0.5, kappa=4.0 ),
algorithm="port", lower=c(0,0), upper=c(acos(xlims[1]),500),
control=list(warnOnly=TRUE) )
##------------------------------------------------------------------
On one machine, nls converges, and on the other it doesn't. Any ideas
why, and which is "right"? I can't see anything in R News that could
be relevant.
The different R versions (and computers) ar...
2013 May 28
3
Ocultar componentes de una lista
...ontrol = structure(list(maxiter = 50, tol = 1e-05, ...
$ dataClasses: Named chr "numeric"
..- attr(*, "names")= chr "Samples"
$ control :List of 5
..$ maxiter : num 50
..$ tol : num 1e-05
..$ minFactor: num 0.000977
..$ printEval: logi FALSE
..$ warnOnly : logi FALSE
- attr(*, "class")= chr "nls"
Como se observa muchos de estos elmentos no son mostrados en el resultado de la funcion a menos que se use la funcion "str"
, quisiera saber como hacer esto, ocultar algunos elementos de una lista producida por una funcio...
2013 May 28
3
Ocultar componentes de una lista
...control = structure(list(maxiter = 50, tol = 1e-05, ...
$ dataClasses: Named chr "numeric"
..- attr(*, "names")= chr "Samples"
$ control :List of 5
..$ maxiter : num 50
..$ tol : num 1e-05
..$ minFactor: num 0.000977
..$ printEval: logi FALSE
..$ warnOnly : logi FALSE
- attr(*, "class")= chr "nls"
Como se observa muchos de estos elmentos no son mostrados en el resultado de la funcion a menos que se use la funcion "str"
, quisiera saber como hacer esto, ocultar algunos elementos de una lista producida por una funcion...
2010 Sep 05
0
cov.unscaled in NLS - how to define cov.scaled to make comparable to SAS proc NLIN output - and theoretically WHY are they different
I am running a 3-parameter nonlinear fit using the default Gauss-Newton
method of nls.
initialValues.L = list(b=4,d=0.04,t=180);
fit.nls.L = nls(
myModel.nlm ,
fData.L,
start = initialValues.L,
control = nls.control(warnOnly = TRUE),
trace=T
);
summary.nls.L = summary(fit.nls.L);
I run the same analysis in SAS proc NLIN.
proc nlin data=apples outest=a;
parms b=4 d=.04 t=180;
model Y = b/(1+exp(-d*(X-t)));
output out=b p=yhat r=yresid ;
run;
proc print data=a;
run;
A summary of the outputs:
- Same coefficients...
2013 Apr 24
0
Understanding how nls() works
....95065902
0.002264977 : 0.14378271 6.94339837 -0.01278772 31.95059050
If I make one parameter further away from optimum, I get this:
> rate.nls <- nls(Dev ~ exp(rho * (T)) - exp(rho*Tmax - (Tmax - T)/del)+
+ lam , data = xx, trace = TRUE,
+ nls.control(warnOnly = TRUE),
+ start = c(rho = 0.15, del = 7, lam = 1.02, Tmax = 30))
59.80968 : 0.15 7.00 1.02 30.00
4.69849 : 0.14673457 6.83443060 -0.01417782 29.94392535
0.06973771 : 0.14787046 6.75099517 -0.01281668 28.88853959
0.0119916 : 0.1460709 6.8333430 -0.0128098 30.1600040...