Questions tagged [nls]

nls refers to nonlinear least-squares and is a function in R that allows to estimate the parameters of a nonlinear model.

nls should not be confused with nls-lang which is an environment variable for Oracle databases.

670 questions
0
votes
1 answer

nls in for loop stops due to Error in nlsModel

If I run a for loop proceeding multiple times nlsLM() sometimes due to useless data Rstudio stops and shows the following error messenge: "Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates" So i…
M Ste
  • 3
  • 3
0
votes
1 answer

R: self-starting function SSasymp with known parameter?

I want to fit an asymptotic model as follow: y(x) = Asym + (R0 - Asym) * exp(-exp(lrc) * x) The model could be fitted in R using nls() function: y <- c(22.180,21.941,21.786,21.724,20.964,19.128,18.371,17.508,16.931) x <-…
Lin
  • 195
  • 1
  • 12
0
votes
0 answers

What's the difference between the nls-function and the power least squares function?

I want to know what the exact difference is between the R-function nls and the least squares method. I thought it was the same, but it gives different outcomes, see the example below. I want to find a power function for data (x,y). I searched the…
Math Girl
  • 129
  • 8
0
votes
0 answers

How do I write this nonlinear regression

what is the correct way of writing this nonlinear regression equation in r a0*(D^a1)*(H^a2)X^(b1(Z^4)+b2*(1/exp(D/H)+b3*(X^0.1)+b4*(1/D)+b5*(H^Q)+b6*X) I tried writing it with the format below but r said I should remove the comma sign(,) between…
T.awesome
  • 1
  • 2
0
votes
1 answer

NLS_TERRITORY in NLS_SESSION_PARAMETERS is not showing correct value after ORACLE 12C Upgrade

we have recently upgraded our test environment database to 12.2.0.1 from 11.2.0.3. I see that NLS_TERRITORY value and NLS_LANG value in NLS_SESSION_PARAMETERS is not showing correct value after ORACLE 12C Upgrade. It should be GERMANY and GERMAN and…
Sanjib Behera
  • 101
  • 1
  • 13
0
votes
1 answer

Error in nonlinear least squeares in R - Logistic and Gompertz curves

I'm working on a model for variable y, in which I intend to use time as an explanatory variable. I've chosen a Gompertz and a logistic curve as candidates, but when I try to estimate the coefficients (using both nls and nls2), I end up getting…
Javier
  • 332
  • 1
  • 4
  • 14
0
votes
1 answer

nls boot error must have positive length

I am getting the error below with nlsBoot() any idea what is wrong? Error in apply(tabboot, 1, quantile, c(0.5, 0.025, 0.975)) : dim(X) must have a positive length set.seed(1) x = 1:100 y = x^2+rnorm(100,50,500) plot(x,y) d = data.frame(x =x,…
user3022875
  • 8,598
  • 26
  • 103
  • 167
0
votes
1 answer

How to avoid "error:singular gradient matrix at initial parameter estimates" using nlsLM?

This is my first post, so I hope that I include everything correctly and thank you for any help that you may be able to give. I am trying to fit a curve, to a set of raw data which I have collected. The data is sigmoid and should be explained by a…
JackR
  • 1
  • 2
0
votes
0 answers

Variable lengths Differ error using nls function in R

I am trying to fit the following data set using non-linear regression where v=rate, s=substrate conc and I=inhibitor conc v s I 1 0.030735 20 0 2 0.036813 30 0 3 0.043511 40 0 4 0.049580 60 0 5 0.053996 70 0 6 0.059996 …
pazchem
  • 1
  • 1
0
votes
1 answer

How get plot from nlrq in R?

Following workflow for nonlinear quantile regression seems to work. However I don´t know how to plot the resulting curve. btw.: I´d prefer to use the function graphics::curve() instead of graphics::lines() require(quantreg) # load sample data dat…
N'ya
  • 347
  • 3
  • 13
0
votes
1 answer

R fitting a double exponential growth curve

I am trying to fit a double exponential growth curve of the form y = a1*exp(b1*x)+a2*exp(b2*x) for the given data set,with nls, however i am always getting a either of the errors (1) Convergence failure: false convergence (2) singular gradient. I am…
user1142937
  • 314
  • 5
  • 19
0
votes
1 answer

Using tapply when you have different n for each treatment

I am an R beginner trying to fit my data to a non-linear regression. Specifically I want to fit the rate of insect development over different temperatures to a power function. Below is my code, modified from the examples at the bottom of this…
buglady
  • 1
  • 1
0
votes
1 answer

Oracle APEX - force session nls_numeric_characters at application or session level

We create reports using APEX and need to present numbers formated with "," as decimal separator and " " as thousand separator. For example: 1000000.001 becomes 1 000 000,001 The solution we currently use is to format every column of our reports…
David
  • 73
  • 2
  • 10
0
votes
2 answers

using R function nls with long list of variables

I am trying to estimate a non-linear model with the R function nls. I will illustrate my problem with an example from the "help" facility for nls. Treated <- Puromycin[Puromycin$state == "treated", ] weighted.MM <- function(resp, conc, Vm, K) { …
Laurent Franckx
  • 161
  • 1
  • 6
0
votes
1 answer

Prediction with nls, always return prediction values of train data set

I have 4 points of the train set, I use "nls" to fit the train set, then predict the response of test set which contains 2 points. However, the "predict" command always returns values of the train set. The code is attached below: ##Following is…
Kevin
  • 17
  • 4