On Fri, 11 Dec 2020 19:20:26 -0500
Gabor Grothendieck wrote:
> The start= argument should be as follows:
>
> nls(y ~ x/(x - a[z]),start=list(a = strt),data=xxx)
Nya-ha! I, uh, clearly wasn't thinking clearly! (Feel a bit *duh*
now!)
Thanks Gabor.
cheers,
Rolf
>
> On Fri, Dec 11, 2020
On 11/12/2020 6:50 p.m., Rolf Turner wrote:
I want to fit a model y = x/(x-a) where the value of a depends
on the level of a factor z. I cannot figure out an appropriate
syntax for nls(). The "parameter" a (to be estimated) should be a
vector of length equal to the number of levels of z.
I t
The start= argument should be as follows:
nls(y ~ x/(x - a[z]),start=list(a = strt),data=xxx)
On Fri, Dec 11, 2020 at 6:51 PM Rolf Turner wrote:
>
>
>
> I want to fit a model y = x/(x-a) where the value of a depends
> on the level of a factor z. I cannot figure out an appropriate
> syntax for
I want to fit a model y = x/(x-a) where the value of a depends
on the level of a factor z. I cannot figure out an appropriate
syntax for nls(). The "parameter" a (to be estimated) should be a
vector of length equal to the number of levels of z.
I tried:
strt <- rep(3,length(levels(z))
names(
Sendt:* 2. april 2020 18:50
> *Til:* Troels Ring
> *Cc:* r-help mailing list
> *Emne:* Re: [R] nls problem
>
>
>
> Roundoff/cancelation error: compare the following. The first is
> equivalent to your function, the last to fitted().
>
>
>
> > with(aedf
alone saves me.
BW
Troels
Fra: William Dunlap
Sendt: 2. april 2020 18:50
Til: Troels Ring
Cc: r-help mailing list
Emne: Re: [R] nls problem
Roundoff/cancelation error: compare the following. The first is equivalent to
your function, the last to fitted().
> with(aedf, t(cbind(1,
Yes, I was waiting to see how long before it would be noticed that this is
not the sort of problem for which nls() is appropriate.
And I'll beat the drum again that nls() uses a simple (and generally
deprecated) forward difference derivative approximation that gets into
trouble a VERY high proport
Roundoff/cancelation error: compare the following. The first is equivalent
to your function, the last to fitted().
> with(aedf, t(cbind(1, pH, pH^2) %*% round(coef(m), digits=2)))
[,1] [,2] [,3] [,4] [,5] [,6]
[,7] [,8] [,9] [,10]
[1,
Simpler:
FPG2 <- function(x, model){
as.vector(cbind(1, x, x^2) %*% coef(model))
}
Hope this helps,
Rui Barradas
Às 12:56 de 02/04/20, Rui Barradas escreveu:
Hello,
Sorry, disregard my previous e-mail.
Instead of your FPG function try
FPG <- function(pH, model) {
coef(model)[1] + co
Hello,
Sorry, disregard my previous e-mail.
Instead of your FPG function try
FPG <- function(pH, model) {
coef(model)[1] + coef(model)[2]*pH + coef(model)[3]*pH^2
}
FPG(aedf$pH, m)
fitted(m)
Hope this helps,
Rui Barradas
Às 12:30 de 02/04/20, Rui Barradas escreveu:
Hello,
Tip: in a for
Hello,
Tip: in a formula, pH^2 = pH*pH is an interaction.
pH^2 = pH*pH = pH + pH + pH:pH = pH
Try I(pH^2)
Hope this helps,
Rui Barradas
Às 12:07 de 02/04/20, Troels Ring escreveu:
Dear friends - I'm on Win10 with R 6.3.1 and have a very simple problem with
nls which apparently gives a decen
Dear friends - I'm on Win10 with R 6.3.1 and have a very simple problem with
nls which apparently gives a decent fit to the parable below, even without
starting values. But when I then think I know the meaning of the three
parameters a, b, and d it goes very wrong. I guess I am again overlooking
so
Dear Vangi,
> Evangelina Viotto
> on Fri, 20 Oct 2017 11:37:12 -0300 writes:
> Hello I´m need fitt growth curve with data length-age. I want to evaluate
> which is the function that best predicts my data, to do so I compare the
> Akaikes of different models. I'm now need
Yes, some form of try() is often needed with nls() to avoid scripts stopping.
You might also find nlxb() from package nlsr more reliable in finding
solutions. It uses analytic derivatives if
available if the model is given as an expression, and a Marquardt stabilized
solver. But do expect it to
?tryCatch
--
Sent from my phone. Please excuse my brevity.
On October 20, 2017 7:37:12 AM PDT, Evangelina Viotto
wrote:
>Hello I´m need fitt growth curve with data length-age. I want to
>evaluate
>which is the function that best predicts my data, to do so I compare
>the
>Akaikes of different mo
Hello I´m need fitt growth curve with data length-age. I want to evaluate
which is the function that best predicts my data, to do so I compare the
Akaikes of different models. I'm now need to evaluate if changing the
initial values changes the parameters and which do not allow to estimate
the model
Given that nls() often gives failures of the "singular gradient" type, you may want to give package nlsr a try with the
nlxb() function. It should be able to use analytic gradients on this expression, has bounds, and uses a Marquardt
stabilized solver. It can still fail, but is more robust than n
Dear list,
I want to apply the same nls function to different subsets of a larger
dataset. These subsets are defined as unique combinations of two
(categorical) variables, each one with two levels, so I should obtain 4
sets of parameters after fitting.
I have managed to do it in a loop, creatin
You may also want to use tools that are more robust.
Package nlmrt uses analytic Jacobian where possible and a Marquardt solver.
Package minpack.lm uses a Marquardt solver, but the forward difference
derivatives of
nls() for its Jacobian.
alpha level work in https://r-forge.r-project.org/R/?gro
> On Nov 29, 2016, at 12:30 AM, Troels Ring wrote:
>
> Dear friends - updated to R 3.3.2 - tried to install nls - got this sad
> response
>
> package ‘nls’ is not available (as a binary package for R version 3.3.2)
>
> I'm on windows 7
I don't see an `nls` package on CRAN. Perhaps it has bee
> On 29 Nov 2016, at 09:30, Troels Ring wrote:
>
> Dear friends - updated to R 3.3.2 - tried to install nls - got this sad
> response
>
> package ‘nls’ is not available (as a binary package for R version 3.3.2)
>
> I'm on windows 7
>
> Did I do something wrong? Will a binary appear eventuall
Dear friends - updated to R 3.3.2 - tried to install nls - got this sad
response
package ‘nls’ is not available (as a binary package for R version 3.3.2)
I'm on windows 7
Did I do something wrong? Will a binary appear eventually? Would I have
to make it myself?
Best wishes
Troels Ring
Aal
On 26 Aug 2015, at 00:34 , Jianling Fan wrote:
> Hello everyone,
>
> I am doing nonlinear regression using a same sigmoidal model for
> different treatments. for each treatment, I got a set of estimated
> parameters (a1, b1, c1 for treatment 1; a2, b2, c2 for treatment 2;
> a3, b3, c3 for treat
This is a statistical question, and is off topic for this list, which
is about R programming. Post to a statistical list, like
stats.stackexchange.com, instead.
Warning: This is not a simple issue. You should seriously consider
getting local advice from someone with the necessary statistical
exper
Hello everyone,
I am doing nonlinear regression using a same sigmoidal model for
different treatments. for each treatment, I got a set of estimated
parameters (a1, b1, c1 for treatment 1; a2, b2, c2 for treatment 2;
a3, b3, c3 for treatment 3). And I want to compare these parameters
for different
Thank you very much Prof.JC Nash
I am still don't understand about that Jacobian. why the model not
approprite.
Really appreciate
King regards
--
View this message in context:
http://r.789695.n4.nabble.com/nls-in-r-tp4711012p4711044.html
Sent from the R help mailing list archive at Nabble.co
This subject is introduced in multivariable calculus, and in more detail in
some numerical analysis courses. Graphing is one common technique for
identifying promising search ranges if the number of variables can be reduced
to one or two. Analytical identification of asymptotes, extrema, and zer
How can you find that starting value ? is there a trick for that ?.
Really appreciate. Thank you very much.
King Regards
--
View this message in context:
http://r.789695.n4.nabble.com/nls-in-r-tp4711012p4711043.html
Sent from the R help mailing list archive at Nabble.com.
I believe that if your try these starting values the sum of squares is
considerably smaller
a=1.0851e-06
b=1.4596e-01
delta=9.1375e-01
something like SS= 0.005236471 vs SS= 0.01597071
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and mor
With package nlmrt, I get a solution, but the Jacobian is essentially
singular, so the model may not be appropriate. You'll need to read the
documentation to learn how to interpret the Jacobian singular values. Or
Chapter 6 of my book "Nonlinear parameter optimization with R tools."
Here's the scr
I get this error
Error in numericDeriv(form[[3L]], names(ind), env) :
Missing value or an infinity produced when evaluating the model
I was replace the starting value but still get error.
Here is my code:
library(stats)
x=c(30:110)
y=c(0.000760289, 0.000800320, 0.000830345, 0.000840353, 0.0008
The list rejects almost all attachments.
You could dput the data and put it in your posting.
You may also want to try a Marquardt solver. In R from my nlmrt or
compiled in Kate Mullen's minpack.lm. They are slightly different in
flavour and the call is a bit different from nls.
JN
On 15-07-16 0
---The las post rejected two files I had attached, so I modified
it.---
Hi. I am trying to make a nls fit for a little bit complicated expression that
includes two integrals with two of the fit parameters in their upper limits.
I got the error "Error in nlsModel(formula, mf, star
Very few attachment types are permitted on the R mailing lists... apparently
whatever file you attached did not qualify.
---
Jeff NewmillerThe . . Go Live...
DCN:Basics: ##.#.
Hi. I am trying to make a nls fit for a little bit complicated expression that
includes two integrals (please find enclosed the equations).
I got the error "Error in nlsModel(formula, mf, start, wts) :
singular gradient
matrix at initial parameter estimates". First of all, I have searched
already
Date: Tue, 2 Jun 2015 02:54:03 +
> From:
> To:
> Subject: [R] nls and four parameter estimates
> Message-ID:
>
> Content-Type: text/plain; charset="UTF-8"
>
> Hello all!
>
> I am trying to estimate four parameters (mu, sigma, theta and lambda)
Hello all!
I am trying to estimate four parameters (mu, sigma, theta and lambda) of a model
Using the nls package in R, I can only get it to work if I limit the number of
parameters to be estimated to three (i.e. mu, sigma and theta) as in the first
model - mod1 - below. Including a fourth param
00
> From: oussama belmejdoub
> To: "r-help@r-project.org"
> Subject: [R] nls model singular gradient matrix at initial parameter
> estimates
> Message-ID:
> Content-Type: text/plain; charset="iso-8859-1"
>
> Greetings,
> I'm trying to use
Greetings,
I'm trying to use the nls function in my statistics project but I'm really
finding lot of difficulties.
I have a function called apinene_modele_prediction that calculates the
estimations:
library(expm); #exp of a matrixapinene_modele_prediction <- function(t,theta) {
x0=c(100,0,0,0,0)
Dear All,
I have made a script in R (r_nonlinear_leastsquare.R) to fit an exponential
decay curve to my data using nls module:
-
args <- commandArgs(trailingOnly = TRUE)
#"/project/dmp
torials are included in conference registration.
Let me know off-list of your progress.
JN
On 14-05-14 06:00 AM, r-help-requ...@r-project.org wrote:
> Message: 29
> Date: Tue, 13 May 2014 13:20:01 -0700 (PDT)
> From: Andras Farkas
> To: "r-help@r-project.org"
Dear All,
please help with writing the function for the following:
we have data frame "raw"
D1 <-c(2, 2, 2, 2, 2, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 20, 20, 20, 20, 20,
50, 50, 50, 50, 50)
D2 <-c(0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2, 5, 0.2, 0.5, 1, 2,
5, 0.2, 0.5, 1, 2, 5)
On 10/28/13 00:10, Hansol Yu wrote:
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
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 th
> -Original Message-
> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
> project.org] On Behalf Of wayne.w.jo...@shell.com
> Sent: 22 October 2013 18:52
> To: R-help@r-project.org
> Subject: [R] nls model definition help
>
> Hi fellow R users,
>
does bounds constraints and also fixed parameters (masks).
JN
On 13-10-23 06:00 AM, r-help-requ...@r-project.org wrote:
> Message: 37
> Date: Tue, 22 Oct 2013 17:52:28 +
> From:
> To:
> Subject: [R] nls model definition help
> Message-ID:
>
> <823fb
Hi fellow R users,
I'm trying to fit a model using nls with the following model definition:
y(t+1)=(th1*x1 + R1*x2) * exp(a1*x3) + (1-th1*x1 + R1*x2)*y(t)
y is the dependent variable (note on both sides of eq) and the x's represent
the regressors.
th1, R1 and a1 are parameters to be estimated.
vid L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77840-4352
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of natan
hoefnagel
Sent: Monday, August 12, 2013 9:54 AM
To: r-help@r-project.org
Subj
Dear All,
I am trying to fit a regression (growth curve) through my data using nls().
I want to learn how this works, so I made up my own simple data:
PGC = function(K, P0, r, t) { (K*P0*exp(r*t)) / (K+P0*(exp(r*t)-1)) }
x <- seq(1:20)
y<-PGC(6, 0.1, 0.4, x)
Plotting this data yields a nice s-
obust.
JN
On 13-07-15 06:00 AM, r-help-requ...@r-project.org wrote:
Message: 9
Date: Sun, 14 Jul 2013 16:11:40 +0100
From: Prof Brian Ripley
To:r-help@r-project.org
Subject: Re: [R] nls power law help
Message-ID:<51e2bfac.1010...@stats.ox.ac.uk>
Content-Type: text/plain; charset=ISO-8859-1
On 14/07/2013 14:30, JenPool wrote:
Hi,
I am trying to use a power law y=bx^a as a nls model as below, however I
keep getting 'singular gradient' error. I have tried multiple different
starting values but always get an error.
That is not the model you tried to fit. b*x*exp(a) is always
over-p
Hi,
I am trying to use a power law y=bx^a as a nls model as below, however I
keep getting 'singular gradient' error. I have tried multiple different
starting values but always get an error.
> x2 <-
> c(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,
> 31,32,33,3
It's hard to say without seeing the data. It could be the data, it could
be the starting values, it could be the model choice.
Jean
On Wed, Jun 19, 2013 at 10:45 AM, pakoun wrote:
> Yes it should look like that... what i am doing is a variogram fit . But
> the
> data of course are spread almo
Yes it should look like that... what i am doing is a variogram fit . But the
data of course are spread almost all over.. I would guess might be problem
with the data only?
--
View this message in context:
http://r.789695.n4.nabble.com/nls-singular-gradient-as-always-tp4669859p4669898.html
Sent
What does a plot of your data look like?
plot(ndat$dist, ndat$vario.dNEE)
Anything remotely like a two-parameter single exponential rise to a maximum
from zero as shown on this webpage, for example?
http://www.graphpad.com/guides/prism/6/curve-fitting/index.htm?reg_classic_1assoc.htm
Jean
O
Hi all. Sorry for posting again such a topic but I went through previous
posts but couldn't find a solution.
I use the following code to fit an exponential model to my data. I have 4
different datasets. For 3 datasets nls seems to work fine and I have no
error messages. But for 1 dataset I am get
On 13-04-26 10:14 AM, Ben Bolker wrote:
Keith Jewell campden.co.uk> writes:
Others have pointed out that the error is probably from an unclean
environment.
Completely OT, but "an unclean environment" sounds sort of scary to me.
Like it contains zombies or something.
Isn't that accurate
Keith Jewell campden.co.uk> writes:
> Others have pointed out that the error is probably from an unclean
> environment.
>
Completely OT, but "an unclean environment" sounds sort of scary to me.
Like it contains zombies or something.
I don't know a better, short way to express the idea though
On 26/04/2013 00:16, Steven LeBlanc wrote:
> Greets,
>
> I'm trying to learn to use nls and was running the example code for
an exponential model:
>
>
>
> Perhaps also, a pointer to a comprehensive and correct document that
details model formulae syntax if someone has one?
>
> Thanks& Best
Hi
Try
x <- -(1:100)/10
set.seed(1)
y <- 100 + 10 * exp(x / 2) + rnorm(x)/10
short cut to starting values
lm(log(y) ~-log(x+10))
Call:
lm(formula = log(y) ~ -log(x + 10))
Coefficients:
(Intercept)
4.624
nlmod <- nls(y ~ A + B * exp(C * x), start=list(A=90, B=5,C=0.1))
Formula: y ~ A +
On Thu, Apr 25, 2013 at 7:16 PM, Steven LeBlanc wrote:
> 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-nu
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 nl
No , but please RSVP if you disagree with me.
John Kane
Kingston ON Canada
> -Original Message-
> From: cl...@ecy.wa.gov
> Sent: Thu, 14 Mar 2013 09:28:46 -0700 (PDT)
> To: gunter.ber...@gene.com
> Subject: Re: [R] NLS results different from Excel -- Tricky fortun
Following up on Bert's nomination, may I take one from a recent email I
received?
"The second file is air concentrations against frequencies plotted by SAS;
however we don't have the SAS statistical package..."
I thought the original name for SAS was Statistical Analysis System--am I
missing
Just as an FYI, there is the NISTnls package on CRAN by Doug Bates:
http://cran.r-project.org/web/packages/NISTnls/index.html
There have also been threads over the years touching on some of the issues in
replicating the NIST results, for example:
http://tolstoy.newcastle.edu.au/R/devel/06/0
I think that this nomination is a Good Idea!
cheers,
Rolf
On 02/21/2013 06:50 AM, Bert Gunter wrote:
Folks:
I thought the following excerpt from Bruce McCullough's post would be
a good candidate for the R fortunes package -- except that it's about
Excel, not R! So I nominate it.
Folks:
I thought the following excerpt from Bruce McCullough's post would be
a good candidate for the R fortunes package -- except that it's about
Excel, not R! So I nominate it... but leave it to others to say
whether it's really "qualified" to be nominated.
"The idea that the Excel solver
The idea that the Excel solver "has a good reputation for being fast and
accurate" does not withstand an examination of the Excel solver's
ability to solve the StRD nls test problems. Solver's ability is
abysmal. 13 of 27 "answers" have zero accurate digits, and three more
have fewer than tw
I use Excel regularly, and do not consider this a "slam"... it is a fact. I am
aware of Solver, but the query was about trend lines generated by Excel. In
general it is possible to do arbitrarily complex computations with a four
function calculator, but we don't describe that as something the ca
Jeff Newmiller dcn.davis.ca.us> writes:
>
> Excel definitely does not use nonlinear least squares fitting for power
> curve fitting. It uses linear LS fitting of the logs of x and y. There
> should be no surprise in the OP's observation.
May I be allowed to say that the general comments on MS Ex
ge: 79
Date: Mon, 18 Feb 2013 22:40:25 -0800
From: Jeff Newmiller
To: Greg Snow<538...@gmail.com>, David Gwenzi
Cc: r-help
Subject: Re: [R] R nls results different from those of Excel ??
Message-ID:<50c09528-7917-4a20-ad0e-5f4ebf9d0...@email.android.com>
Content-Type: text/plain; charset=UTF-8
Excel definitely does not use nonlinear least squares fitting for power curve
fitting. It uses linear LS fitting of the logs of x and y. There should be no
surprise in the OP's observation.
---
Jeff Newmiller
To paraphrase Bill Venables (see fortune(217)):
Simple. Excel must be broken. Have you reported it to them?
(The difference in this case is that it is probable that Excel *is* broken.
It usually is.)
cheers,
Rolf Turner
On 02/19/2013 05:49 PM, David Gwenzi wrote:
Hi all
I
Have you plotted the data and the lines to see how they compare? (see
fortune(193)).
Is there error around the line in the data? The nls function is known to
not work well when there is no error around the line. Also check and make
sure that the 2 methods are fitting the same model.
You might
Hi all
I have a set of data whose scatter plot shows a very nice power
relationship. My problem is when I fit a Power Trend Line in an Excel
spreadsheet, I get the model y= 44.23x^2.06 with an R square value of 0.72.
Now, if I input the same data into R and use
model< -nls(y~ a*x^b , trace=TRUE, d
Please read the posting guide and use a sensible subject line, tell us
about the R version you are using, and add a *reproducible* example.
We get:
Error in nls(npe ~ SSgompertz(npo, Asym, b2, b3), data = f, control =
nls.control(maxiter = 500)) :
object 'f' not found
Best,
Uwe Ligges
On
Would you show the exact message you get please.
-- Bert
On Thu, Jan 3, 2013 at 5:22 AM, Karine HEERAH <
karine.hee...@locean-ipsl.upmc.fr> wrote:
> 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 5
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))
T
1. Fit a simpler model -- you're probably overfitting.
2. Consult your local statistician.
3. Post to stats.stackexchange.com, as this appears to be primarily a
statistical issue, not an R issue. But 2) would probably be better.
Cheers,
Bert
On Sun, Dec 16, 2012 at 3:57 PM, Diviya Smith wrote:
>
Hi there,
I am trying to fit the following model with a sum of exponentials -
y ~ Ae^(-md) + B e^(-nd) + c
the model has 5 parameters A, b, m, n, c
I am using nls to fit the data and I am using DEoptim package to pick the
most optimal start values -
fm4 <- function(x) x[1] + x[2]*exp(x[3] * -d
Hello all-
I got some help on this. While it did not fix the problem with nls, one can
get around the problem by creating a data frame with the NAs excluded. As
follows:
goodidx<-which(! is.na(warming$T10cm))
warming2<-warming[goodidx,]
warm.10<-nls(umoles60~alpha*exp(beta*T10cm),start = start,
Hi-
I am using the following code:
start=c(alpha=0.4,beta=0.4)
warm.10<-nls(warming$umoles60~alpha*exp(beta*warming$T10cm),start =
start,data=warming,na.action=na.omit)
This code works for other columns in my dataset that are similar to $T10cm
but the code does not work for this particular
thanks
it seems to be a good idea. a also find the PK package with the biexp
function.
2012/8/23 Peter Ehlers
>
> Have you checked help(SSbiexp) ?
>
> Peter Ehlers
>
>
> On 2012-08-23 04:54, vincent guyader wrote:
>
>> Hi everyone,
>>
>> I'm trying to perform a bi exponential Fit with the pac
Have you checked help(SSbiexp) ?
Peter Ehlers
On 2012-08-23 04:54, vincent guyader wrote:
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*ex
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)),
alg
On Wed, Aug 15, 2012 at 9:08 PM, li li wrote:
> Dear all,
> I have a question on the four parameter logistic regression.
> Not sure about how to set the start values for the parameters.
> Can anyone familiar with this give some hint? Thanks so much.
>
>
See ?SSfpl which is the self-starter four
Dear all,
I have a question on the four parameter logistic regression.
Not sure about how to set the start values for the parameters.
Can anyone familiar with this give some hint? Thanks so much.
Hannah
For example, suppose I have the following data values,
> temp
mean_st
gt;Cc: "r-help@r-project.org"
>Sent: Thursday, July 12, 2012 1:03 PM
>Subject: Re: [R] nls question
>
>On Thu, Jul 12, 2012 at 3:40 PM, Felipe Carrillo
> wrote:
>> I get a different error now:
>>> nls(weight ~ cbind(1, exp(gamma*week)), weightData, start
To add to Gabor's remarks:
This has nothing to do per se with R -- it is your insufficient
understanding of the underlying mathematical issues.
It is pretty trivial to do the plinear algorithm by hand. Fit linear
regressions
weight ~ lm(weight ~z)
where z is exp(gamma*week) for a suitable sequen
On Thu, Jul 12, 2012 at 3:40 PM, Felipe Carrillo
wrote:
> I get a different error now:
>> nls(weight ~ cbind(1, exp(gamma*week)), weightData, start = list(gamma=
>> 0.2), alg = "plinear")
> Error in nls(weight ~ cbind(1, exp(gamma * week)), weightData, start =
> list(gamma = 0.2), :
> step fac
px
>
>From: Gabor Grothendieck
>To: Felipe Carrillo
>Cc: Bert Gunter ; "r-help@r-project.org"
>
>Sent: Thursday, July 12, 2012 12:14 PM
>Subject: Re: [R] nls question
>
>On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo
> wr
On Thu, Jul 12, 2012 at 3:02 PM, Felipe Carrillo
wrote:
> Thanks Bert, I increased the number of iterations:
>
> M_model <- nls(weight ~ alpha +
> beta*exp(gamma*week),control=nls.control(maxiter=200), weightData,
> start = c(alpha = 0.0, beta = 1, gamma = 0.2), trace = TRUE)
>
> Bu
e
California, USA
http://www.fws.gov/redbluff/rbdd_jsmp.aspx
>
>From: Bert Gunter
>To: Felipe Carrillo
>Cc: "r-help@r-project.org"
>Sent: Thursday, July 12, 2012 10:56 AM
>Subject: Re: [R] nls question
>
>
>Read the Help file
Read the Help file!
?nls ## Note the "control" argument
?nls.control
-- Bert
On Thu, Jul 12, 2012 at 10:47 AM, Felipe Carrillo
wrote:
> Hi:
> Using nls how can I increase the numbers of iterations to go beyond 50.
> I just want to be able to predict for the last two weeks of the year.
> Thi
See ?nls.control (referenced from ?nls).
On 12/07/2012 18:47, Felipe Carrillo wrote:
Hi:
Using nls how can I increase the numbers of iterations to go beyond 50.
I just want to be able to predict for the last two weeks of the year.
This is what I have:
weight_random <- runif(50,1,24)
Hi:
Using nls how can I increase the numbers of iterations to go beyond 50.
I just want to be able to predict for the last two weeks of the year.
This is what I have:
weight_random <- runif(50,1,24)
weight <- sort(weight_random);weight
weightData <- data.frame(weight,week=1:50)
ace=TRUE)
--
Best, JN
On 07/12/2012 06:00 AM, r-help-requ...@r-project.org wrote:
> From: Jonas Stein
> To:
> Subject: [R] nls problem: singular gradient
> Message-ID:
> Content-Type: text/plain
>
> Why fails nls with "singular gradient&qu
On Jul 11, 2012, at 20:34 , Jonas Stein wrote:
>> Take a look at the predicted values at your starting fit: there's a
>> discontinuity at 0.4, which sure makes it look as though overflow is
>> occurring. I'd recommend expanding tanh() in terms of exponentials and
>> rewrite the prediction in
On 07/12/2012 01:39 AM, Duncan Murdoch wrote:
On 12-07-11 2:34 PM, Jonas Stein wrote:
Take a look at the predicted values at your starting fit: there's a
discontinuity at 0.4, which sure makes it look as though overflow is
occurring. I'd recommend expanding tanh() in terms of exponentials and
re
On 12-07-11 2:34 PM, Jonas Stein wrote:
Take a look at the predicted values at your starting fit: there's a
discontinuity at 0.4, which sure makes it look as though overflow is
occurring. I'd recommend expanding tanh() in terms of exponentials and
rewrite the prediction in a way that won't over
1 - 100 of 364 matches
Mail list logo