Displaying 20 results from an estimated 3000 matches similar to: "Non-linear regression analysis in R"
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 Dec 18
2
NLS-Weibull-ERROR
Hello
I was trying to estimate the weibull model using nls after putting OLS
values as the initial inputs to NLS.
I tried multiple times but still i m getting the same error of Error in
nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates.
The Program is as below
> vel <- c(1,2,3,4,5,6,7,8,9,10,11,12,13,14)
> df <- data.frame(conc, vel)
>
2012 Jan 19
3
fitting an exp model
Hello there,
I am trying to fit an exponential model using nls to some data.
#data
t <- c(0,15,30,60,90,120,240,360,480)
var <- c(0.36,9.72,15.50,23.50,31.44,40.66,59.81,73.11,81.65)
df <- data.frame(t, var)
# model
# var ~ a+b*(1-exp(-k*t))
# I'm looking for values of a,b and k
# formula
# mod <- nls(formula = var ~ a+b *(1-exp((-k)*t)), start=list(a=0, b=10,
2011 Jun 30
1
Error "singular gradient matrix at initial parameter estimates" in nls
Greetings,
I am struggling a bit with a non-linear regression. The problem is
described below with the known values r and D inidcated.
I tried to alter the start values but get always following error
message:
Error in nlsModel(formula, mf, start, wts):
singular gradient matrix at initial parameter estimates
Calls: nls -> switch -> nlsModel
I might be missing something with regard to the
2011 Nov 30
2
nls help
Hello,
I have data like the following:
datum <- structure(list(Y = c(415.5, 3847.83333325, 1942.833333325,
1215.22222233333,
950.142857325, 2399.5833335, 804.75, 579.5, 841.708333325, 494.053571425
), X = c(1.081818182, 0.492727273, 0.756363636, 0.896363636,
1.518181818, 0.499166667, 1.354545455, 1.61, 1.706363636, 1.063636364
)), .Names = c("Y", "X"), row.names = c(NA,
2009 Aug 25
3
Covariates in NLS (Multiple nonlinear regression)
Dear R-users,
I am trying to create a model using the NLS function, such that:
Y = f(X) + q + e
Where f is a nonlinear (Weibull: a*(1-exp(-b*X^c)) function of X and q is a covariate (continous variable) and e is an error term. I know that you can create multiple nonlinear regressions where x is polynomial for example, but is it possible to do this kind of thing when x is a function with unknown
2013 Mar 14
2
question about nls
Hi,all:
I met a problem of nls.
My data:
x y
60 0.8
80 6.5
100 20.5
120 45.9
I want to fit exp curve of data.
My code:
> nls(y ~ exp(a + b*x)+d,start=list(a=0,b=0,d=1))
Error in nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates
I can't find out the reason for the error.
Any suggesions are welcome.
Many thanks.
[[alternative HTML
2007 Feb 13
1
nls: "missing value or an infinity" (Error in numericDeriv) and "singular gradient matrix"Error in nlsModel
Hi,
I am a non-expert user of R. I am essaying the fit of two different functions to my data, but I receive two different error messages. I suppose I have two different problems here... But, of which nature? In the first instance I did try with some different starting values for the parameters, but without success.
If anyone could suggest a sensible way to proceed to solve these I would be
2010 Apr 28
1
NLS "Singular Gradient" Error
Hello,
I am trying to model a type II functional response of number of prey eaten
(Ne) against number supplied (No) with a non-linear least squares regression
(nls). I am using a modification of Holling's (1959) disc equation to
account for non-replacement of prey;
Ne=No{1-exp[a(bNe-T)]}
where a is the attack rate, b is the handling time, and T is the
experimental period.
My script is as
2008 Nov 18
2
error in function: nls (urgent)
Hi,all:
I am running a nonlinear regression and there is a problem.
There is a data frame: data
p s x t
1 875.0 12392.5 11600 0.06967213
2 615.0 12332.5 12000 0.06967213
3 595.0 12332.5 12000 0.06967213
4 592.5 12337.0 12000 0.06967213
5 650.0 12430.0 12000 0.06967213
6 715.0 12477.5 12000 0.06967213
.
.
.
.
str(data):
'data.frame': 234 obs. of 4 variables:
2010 Mar 30
6
Error "singular gradient matrix at initial parameter estimates" in nls
I am using nls to fit a non linear function to some data.
The non linear function is:
y= 1- exp(-(k0+k1*p1+ .... + kn*pn))
I have chosen algorithm "port", with lower boundary is 0 for all of the
ki parameters, and I have tried many start values for the parameters ki
(including generating them at random).
If I fit the non linear function to the same data using an external
2023 Aug 20
3
Issues when trying to fit a nonlinear regression model
Dear friends,
This is the dataset I am currently working with:
>dput(mod14data2_random)
structure(list(index = c(14L, 27L, 37L, 33L, 34L, 16L, 7L, 1L,
39L, 36L, 40L, 19L, 28L, 38L, 32L), y = c(0.44, 0.4, 0.4, 0.4,
0.4, 0.43, 0.46, 0.49, 0.41, 0.41, 0.38, 0.42, 0.41, 0.4, 0.4
), x = c(16, 24, 32, 30, 30, 16, 12, 8, 36, 32, 36, 20, 26, 34,
28)), row.names = c(NA, -15L), class =
2011 May 01
1
Urgent: conditional formula for nls
I have data vectors x and y both with 179 observations. I'm trying to
fit a nonlinear model with five parameters using nls. The formula is
only defined within a range of x-values, it should be zero otherwise,
thus my attempted use of ifelse:
> df<-data.frame(x,y)
>
2011 Jun 12
2
NLS fit for exponential distribution
Hello there,
I am trying to fit an exponential fit using Least squares to some data.
#data
x <- c(1 ,10, 20, 30, 40, 50, 60, 70, 80, 90, 100)
y <- c(0.033823, 0.014779, 0.004698, 0.001584, -0.002017, -0.003436,
-0.000006, -0.004626, -0.004626, -0.004626, -0.004626)
sub <- data.frame(x,y)
#If model is y = a*exp(-x) + b then
fit <- nls(y ~ a*exp(-x) + b, data = sub, start
2017 Jun 21
0
fitting cosine curve
I'm trying the different parameters, but don't know what the error is:
Error in nlsModel(formula, mf, start, wts) :
singular gradient matrix at initial parameter estimates
Thanks for any suggestions.
On Tue, Jun 20, 2017 at 7:37 PM, Don Cohen <don-r-help at isis.cs3-inc.com>
wrote:
>
> If you know the period and want to fit phase and amplitude, this is
> equivalent to
2010 Jan 13
1
Problem fitting a non-linear regression model with nls
Hi,
I'm trying to make a regression of the form :
formula <- y ~ Asym_inf + Asym_sup * ( (1 / (1 + (n1 * (exp( (tmid1-x)
/ scal1) )^(1/n1) ) ) ) - (1 / (1 + (n2 * (exp( (tmid2-x) / scal2)
)^(1/n2) ) ) ) )
which is a sum of the generalized logistic model proposed by richards.
with data such as these:
x <- c(88,113,128,143,157,172,184,198,210,226,240,249,263,284,302,340)
y <-
2023 Aug 20
1
Issues when trying to fit a nonlinear regression model
I got starting values as follows:
Noting that the minimum data value is .38, I fit the linear model log(y -
.37) ~ x to get intercept = -1.8 and slope = -.055. So I used .37,
exp(-1.8) and -.055 as the starting values for theta0, theta1, and theta2
in the nonlinear model. This converged without problems.
Cheers,
Bert
On Sun, Aug 20, 2023 at 10:15?AM Paul Bernal <paulbernal07 at
2006 Sep 07
0
Help understanding how nls parses the formula argument to estimate the model
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,
2006 Sep 21
0
Help understanding how nls parses the formula argument to estimate the model
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,
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