Displaying 20 results from an estimated 110 matches similar to: "nls NAs"
2012 Jul 11
2
nls problem: singular gradient
Why fails nls with "singular gradient" here?
I post a minimal example on the bottom and would be very
happy if someone could help me.
Kind regards,
###########
# define some constants
smallc <- 0.0001
t <- seq(0,1,0.001)
t0 <- 0.5
tau1 <- 0.02
# generate yy(t)
yy <- 1/2 * ( 1- tanh((t - t0)/smallc) * exp(-t / tau1) ) + rnorm(length(t))*0.01
# show the curve
2013 Apr 01
2
Is DUD available in nls()?
SAS has DUD (Does not Use Derivatives)/Secant Method for nonlinear
regression, does R offer this option for nonlinear regression?
I have read the helpfile for nls() and could not find such option, any
suggestion?
Thanks,
Derek
[[alternative HTML version deleted]]
2012 Jun 04
2
Non-linear curve fitting (nls): starting point and quality of fit
Hi all,
Like a lot of people I noticed that I get different results when I use nls
in R compared to the exponential fit in excel. A bit annoying because often
the R^2 is higher in excel but when I'm reading the different topics on this
forum I kind of understand that using R is better than excel?
(I don't really understand how the difference occurs, but I understand that
there is a
2012 Oct 18
3
Upper limit in nlsLM not working as expected
Dear all,
I am using the nlsLM function to fit a Lorentzian function to my experimental data.
The LM algorithm should allow to specify limits, but the upper limit appears not to work as expected in my code.
The parameter 'w', which is peak width at half maximuim always hits the upper limit if the limit is specified. I would expect the value to be in-between the upper and lower limit with
2013 Oct 03
2
SSweibull() : problems with step factor and singular gradient
SSweibull() : problems with step factor and singular gradient
Hello
I am working with growth data of ~4000 tree seedlings and trying to fit non-linear Weibull growth curves through the data of each plant. Since they differ a lot in their shape, initial parameters cannot be set for all plants. That’s why I use the self-starting function SSweibull().
However, I often got two error messages:
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 =
2012 Apr 17
3
error using nls with logistic derivative
Hi
I?m trying to fit a nonlinear model to a derivative of the logistic function
y = a/(1+exp((b-x)/c)) (this is the parametrization for the SSlogis function with nls)
The derivative calculated with D function is:
> logis<- expression(a/(1+exp((b-x)/c)))
> D(logis, "x")
a * (exp((b - x)/c) * (1/c))/(1 + exp((b - x)/c))^2
So I enter this expression in the nls function:
2012 May 17
3
nls and if statements
Hi All,
I have a situation where I want an 'if' variable to be parameterized. It's
entirely possible that the way I'm trying to do this is wrong, especially
given the error message I get that indicates I can't do this using an 'if'
statement.
Essentially, I have data where I think a relationship enters when a variable
(here Pwd) is below some value (z). I don't
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
2012 Mar 18
1
Converting expression to a function
Previously, I've posted queries about this, and thanks to postings and messages in
response have recently had some success, to the extent that there is now a package called
nlmrt on the R-forge project https://r-forge.r-project.org/R/?group_id=395 for solving
nonlinear least squares problems that include small or zero residual problems via a
Marquardt method using a call that mirrors the nls()
2013 Mar 15
2
nlrob and robust nonlinear regression with upper and/or lower bounds on parameters
I have a question regarding robust nonlinear regression with nlrob. I
would like to place lower bounds on the parameters, but when I call
nlrob with limits it returns the following error:
"Error in psi(resid/Scale, ...) : unused argument(s) (lower = list(Asym
= 1, mid = 1, scal = 1))"
After consulting the documentation I noticed that upper and lower are
not listed as parameter in
2013 Jul 09
3
fitting log function: errors using nls and nlxb
Hi-
I am trying to fit a log function to my data, with the ultimate goal of
finding the second derivative of the function. However, I am stalled on
the first step of fitting a curve.
When I use the following code:
FG2.model<-(nls((CO2~log(a*Time)+b), start=setNames(coef(lm(CO2 ~
log(Time), data=FG2)), c("a", "b")),data=FG2))
I get the following error:
Error in
2013 Apr 05
2
Assessing the fit of a nonlinear model to a new dataset
Hi all,
I am attempting to apply a nonlinear model developed using nls to a new dataset and assess the fit of that model. At the moment, I am using the fitted model from my fit dataset as the starting point for an nls fit for my test dataset (see below). I would like to be able to view the t-statistic and p-values for each of the iterations using the trace function, but have not yet worked out
2012 Apr 10
3
nls function
Hi,
I've got the following data:
x<-c(1,3,5,7)
y<-c(37.98,11.68,3.65,3.93)
penetrationks28<-dataframe(x=x,y=y)
now I need to fit a non linear function so I did:
fit <- nls(y ~ I(a+b*exp(1)^(-c * x)), data = penetrationks28, start =
list(a=0,b = 1,c=1), trace = T)
The error message I get is:
Error in nls(y ~ I(a + b * exp(1)^(-c * x)), data = penetrationks28, start =
list(a =
2016 Apr 26
5
Linear Regressions with constraint coefficients
Hi all,
I hope you are doing well?
I?m currently using the lm() function from the package stats to fit linear multifactor regressions.
Unfortunately, I didn?t yet find a way to fit linear multifactor regressions with constraint coefficients? I would like the slope coefficients to be all inside an interval, let?s say, between 0 and 1. Further, if possible, the slope coefficients should add up to
2013 Feb 19
3
R nls results different from those of Excel ??
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, data= my_data, start = c(a=40, b=2)) I
get a solution with a = 246.29 and b = 1.51. I have tried
2016 Apr 28
2
Linear Regressions with constraint coefficients
Hi Gabor,
Thanks a lot for your help!
I tried to implement your nonlinear least squares solver on my data set. I was just wondering about the argument start. If I would like to force all my coefficients to be inside an interval, let?s say, between 0 and 1, what kind of starting values are normally recommended for the start argument (e.g. Using a 4 factor model with b1, b2, b3 and b4, I tried
2016 Apr 26
0
Linear Regressions with constraint coefficients
This is a quadratic programming problem that you can solve using
either a quadratic programming solver with constraints or a general
nonlinear solver with constraints. See
https://cran.r-project.org/web/views/Optimization.html
for more info on what is available.
Here is an example using a nonlinear least squares solver and
non-negative bound constraints. The constraint that the coefficients
sum
2005 Oct 10
1
using innov in arima.sim
Hello,
I have used the arima.sim function to generate a lot of time series, but to day I got som results that I didn't quite understand. Generating two time series z0 and z1 as
eps <- rnorm(n, sd=0.03)
z0 <- arima.sim(list(ar=c(0.9)), n=n, innov=eps)
and
z1 <- arima.sim(list(ar=c(0.9)), n=n, sd=0.03),
I would expect z0 and z1 to be qualitatively similar. However, with n=10 the
2016 Apr 28
0
Linear Regressions with constraint coefficients
The nls2 package can be used to get starting values.
On Thu, Apr 28, 2016 at 8:42 AM, Aleksandrovic, Aljosa (Pfaeffikon)
<Aljosa.Aleksandrovic at man.com> wrote:
> Hi Gabor,
>
> Thanks a lot for your help!
>
> I tried to implement your nonlinear least squares solver on my data set. I was just wondering about the argument start. If I would like to force all my coefficients to