search for: plinear

Displaying 20 results from an estimated 75 matches for "plinear".

Did you mean: linear
2008 Oct 02
1
nls with plinear and function on RHS
...t;- list(Ca=4, Cb=3, Cc=3, Cd=3) In these idealised circumstances nls converges using the default algorithm. # nls, default algorithm nls(y ~ Ca + Cb*x + Cc*x^Cd, data=aDF, start=startL) Unfortunately, in reality it often fails to converge. This model is linear in a, b and c so I've used the plinear algorithm. # nls, plinear algorithm, explicit RHS nls(y ~ cbind(Ca=1,Cb=x, Cc=x^Cd), data=aDF, start=startL["Cd"], algorithm="plinear") This converges much more often but sometimes crashes with the error message "Error in numericDeriv(form[[3]], names(ind), env) : Missi...
2008 May 06
2
NLS plinear question
Hi All. I've run into a problem with the plinear algorithm in nls that is confusing me. Assume the following reaction time data over 15 trials for a single unit. Trials are coded from 0-14 so that the intercept represents reaction time in the first trial. trl RT 0 1132.0 1 630.5 2 1371.5 3 704.0 4 488.5 5 575.5...
2005 Jun 21
2
nls(): Levenberg-Marquardt, Gauss-Newton, plinear - PI curve fitting
...and c are variables: y~1/(a*x^2+b*x+c) With the standardalgorithm "Newton-Gauss" the fitted curve contain an peak near the second x,y-point. This peak is not correct for my purpose. The fitted curve should descend from the maximum y to the minimum y given in my data. The algorithm "plinear" give me following error: phi function(x,y) { k.nls<-nls(y~1/(a*(x^2)+b*x+c),start=c(a=0.0005,b=0.02,c=1.5),alg="plinear") coef(k.nls) } phi(k[,1],k[,2]) Error in qr.solve(QR.B, cc) : singular matrix `a' in solve I have found in the mailinglist &quot...
2018 May 05
0
Bug in profile.nls with algorithm = "plinear"
Dear sirs It seems like there is a bug in `profile.nls` with `algorithm = "plinear"` when a matrix is supplied on the right hand side. Here is the bug and a potential fix ##### # example where profile.nls does not work with `plinear` but does with # `default` require(graphics) set.seed(1) DNase1 <- subset(DNase, Run == 1) x <- rnorm(nrow(DNase1)) f1 <- nls(density...
2008 Jul 08
2
nls and "plinear" algorithm
hello all i havnt had a chance to read through the references provided for the "nls" function (since the libraries are closed now). can anyone shed some light on how the "plinear" algorithm works? also, how are the fitted values obtained? also, WHAT DOES THE ".lin" below REPRESENT? thanking you in advance ###################################### i have a quick example: (data below) f1=nls(r~242*(p+exp(-a1*p)/a1-1/a1)*(1-exp(-a2*o))/( (100+exp(-a1*100)/a1-1/...
2006 Jan 08
1
confint/nls
...n R-devel, not R-patched. a synopsis of the problems with confint(): with a 1-parameter model (is confint not appropriate for 1-parameter models? it doesn't say so in the docs [by the way, "normality" is misspelled as "nornality" in ?confint]): algorithm=default or plinear: get a complaint from qr.qty ('qr' and 'y' must have the same number of rows) port: "cannot allocate vector of size [large]" [caused by C code looking for dims when they aren't there] 2-parameter models: default OK port "cannot allocate vector&quo...
2008 Apr 29
0
nls plinear formula
I want to fit a nonlinear model of the form: Y=A+B*X1+C*X2+log(X3/(X3+D)) I think that the best way is to use the plinear algorithm, but I don't know how to specify the formula in the nls function. I've tried: Y~cbind(rep(1,times=length(Y)),X1,X2,log(X3/(X3+D))) But this fits the model: Y=A+B*X1+C*X2+D1*log(X3/(X3+D)) How can I specify the formula correctly? Thanks, M
2011 Dec 12
0
"plinear"
I was wondering if there is way to place constraints upon the "plinear" algorithm of nls, or rather is there a manner in which this can be achieved because nls does not allow this to be done. I only want to place constraints on one of the nonlinear parameters, a, such that it is between 0 and 1. I have attempted to use a=pnorm(a*) , but then the fitting proced...
2012 Aug 23
1
NLS bi exponential Fit
Hi everyone, I'm trying to perform a bi exponential Fit with the package NLS. the plinear algorithm seems to be a good choice see: p<-3000 q<-1000 a<--0.03 b<--0.02 t<-seq(0:144);t y<-p*exp(a*t) + q*exp(b*t)+rnorm(t,sd=0.3*(p* exp(a*t) + q*exp(b*t))) fittA <- nls(y~cbind(exp(a*t), exp(b*t)), algorithm="plinear",start=list(a=-.1, b=-0.2), data=list(y=y, t...
2010 Apr 15
2
using nls for gamma distribution (a,b,d)
...~ (((age-d)^(b-1))/((gamma(b))*(a^b)))* exp(-((age-d)/a))) gamma.asfr1 <- nls(gamma.asfr, data= asfr.aus, start = list(b = 28, a = 1, d= 0.5), trace = TRUE) error: Error in numericDeriv(form[[3L]], names(ind), env) : Missing value or an infinity produced when evaluating the model when I use plinear algoritm, and run this gamma.asfr1 <- nls(gamma.asfr, data= asfr.aus, start = list(b = 28, a = 1, d= 0.5), trace = TRUE, algorithm="plinear") error: number of iterations exceeded maximum of 50 then i fix the iteration and minFactor even then its can't work gamma.asfr1 <- nls...
2003 Mar 26
1
nls
...n numericDeriv(form[[3]], names(ind), env) : Missing value or an Infinity produced when evaluating the model df <- read.table("data.txt", header=T); df1 = na.omit(df[, 1:2]) library(nls); fm = nls(y ~ (x+d)^(-exp(lb)), data = df1, start=c(lb = 0, d = 0),alg = 'plinear', trace = TRUE); I would be glad if someone can help me. Thanks & Regards, Sai Charan Komanduru >To: Komanduru Sai C <sck2348 at cacs.louisiana.edu> >Cc: r-help at stat.math.ethz.ch >Subject: Re: [R] nls >From: Douglas Bates <bates at stat.wisc.edu> >Date:...
2007 Dec 24
1
curve fitting problem
...o some data points, with reasonable starting value estimates (I think). I keep getting "singular matrix 'a' in solve". This is the code: ox <- c(-600,-300,-200,1,100,200) ir <- c(1,2.5,4,9,14,20) model <- nls(ir ~ k*l^(m*ox),start=list(k=10,l=3,m=0.004),algorithm="plinear") summary(model) plot(ox,ir) testox <- seq(-600,200,length=100) k <- 10 l <- 3 m <- 0.004 testir <- k*l^(m*testox) lines(testox,testir) Any thoughts? Thanks! -- This message was sent on behalf of pieterprovoost at gmail.com at openSubscriber.com http://www.opensubscriber.com/m...
2011 Jun 15
4
Problems with nls
...m = 1,to = 12, by = 1) ## Models Bass.Model <- adoption ~ ((p + q)^2/p) * (exp(-(p + q) * time)/((q / p) * exp(-(p + q) * time) + 1)^2) ## Starting Parameters Bass.Params <- list(p = 0.1, q = 0.1) ## Model fitting Bass.Fit <- nls(formula = Bass.Model, start = Bass.Params, algorithm = "plinear", trace = TRUE) Chris Hulme-Lowe University of Minnesota Department of Psychology Quant. Methods and Psychometrics [[alternative HTML version deleted]]
2012 Jan 30
1
Problem in Fitting model equation in "nls" function
...l,myday) # data object ### fitting model equation in "nls" function ### when i assigned initial value for tt = 0.6,   CASE-I:   > mytest <- nls(rl ~ (c/r)*log(1+exp(r*(myday-tt))), data = mydata, + na.action = na.omit, + start = list(c = 2.0, r = 0.05, tt = 0.6),algorithm = "plinear") Error in numericDeriv(form[[3L]], names(ind), env) :   Missing value or an infinity produced when evaluating the model   CASE - II: When i assigned initial value for tt = 1:   > mytest <- nls(rl ~ (c/r)*log(1+exp(r*(myday-tt))), data = mydata, + na.action = na.omit, + start = list(c...
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 list, the elements of the list must be numeric vectors of length 1. Ie, start = list(a=1,b=2,c=3) is ok, but start = list(a=c(1,2), b=3) is not. This is not the case when algorithm is &quot...
2012 Jan 31
4
problem in fitting model in NLS function
...frame(rl,myday) # data object # fitting model equation in "nls" function, when i assigned initial value for tt = 0.6, CASE-I: > mytest <- nls(rl ~ (c/r)*log(1+exp(r*(myday-tt))), data = mydata, + na.action = na.omit, + start = list(c = 2.0, r = 0.05, tt = 0.6),algorithm = "plinear") Error in numericDeriv(form[[3L]], names(ind), env) :   Missing value or an infinity produced when evaluating the model   CASE - II: When i assigned initial value for tt = 1:   > mytest <- nls(rl ~ (c/r)*log(1+exp(r*(myday-tt))), data = mydata, + na.action = na.omit, + start = list(c...
2008 Jul 09
2
Port package
Hi When I type: > ?nls I come across this section: algorithm: character string specifying the algorithm to use. The default algorithm is a Gauss-Newton algorithm. Other possible values are '"plinear"' for the Golub-Pereyra algorithm for partially linear least-squares models and '"port"' for the 'nl2sol' algorithm from the Port package. The simple question is: where's the Port package? I can't find it on cran. Thanks, Jos
2006 Sep 15
1
Formula aruguments with NLS and model.frame()
...mf<-evalq(mf,data); n<-nrow(mf) mf<-as.list(mf); wts <- if (!mWeights) model.weights(mf) else rep(1, n) if (any(wts < 0 | is.na(wts))) stop("missing or negative weights not allowed") m <- switch(algorithm, plinear = nlsModel.plinear(formula, mf, start, wts), port = nlsModel(formula, mf, start, wts, upper), nlsModel(formula, mf, start, wts)); I am struggling with the environment issues associated with performing these operations. I did not include the data because it is 9000 observations of...
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: >
2005 Oct 31
2
nls() fit to Kahnemann/ Tversky function
...elt.prob.kum) ## looks a little like an "S" gamma <- rep(0.5, 10) nls.dataframe <- data.frame(p.kum,felt.prob.kum, gamma) nls.kurve <- nls( formula = felt.prob.kum ~ p.kum^gamma/(p.kum^gamma+(1-p.kum)^gamma)^(1/gamma), data=nls.dataframe, start=c(gamma=gamma), algorithm="plinear" ) summary(nls.kurve) gives: Error in La.chol2inv(x, size) : 'size' cannot exceed nrow(x) = 10 If I go with the Gauss-Newton algorithm I get an singular gradient matrix error, so I tried the Golub-Pereyra algorithm for partially linear least-squares. It also seems the n...