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
1
vote
1 answer

Predict() in wider range

I am sorry to repeat this question over and over but it seems that I have poor understanding in predicting wider range. It seems that if the data's nrow matches well with predicting values you have no error. However, if you want to predict for…
Alexander
  • 4,527
  • 5
  • 51
  • 98
1
vote
1 answer

nls converging but giving error

I am facing a strange issue. Is probably stupid but I don't see it and would appreciate help. Consider the following code x<-seq(100, 1000, 100) b<-0.3 y<-x^-b Now let's suppose I want to fit a model and I use, for illustration purposes the…
Umberto
  • 1,387
  • 1
  • 13
  • 29
1
vote
1 answer

How to properly insert some special characters like trademark to Oracle database

I have an Oracle database. I have to execute some insert scripts that fill a nvarchar2 column. The insert statements include some special characters like “(left quote), ”(right quote), ™(trademark sign). create table myTable ( column1 number,…
1
vote
2 answers

R - non linear regression (nls) and polynomial interactions (poly)

I can run a nls regression at R if I explicitly define the parameters ("a" and "b" in the example below). However, how could I code the nls with a generic number of variables/higher degress in the poly function? df <- data.frame(var1 = rnorm(100),…
Rodrigo Remedio
  • 640
  • 6
  • 20
1
vote
1 answer

What I'm doing wrong here when trying to convert an nlmrt object to an nls object

I am trying to convert an "nlmrt object to an "nls" object using nls2. However, I can only manage to do it if I write explicitly the names of the parameters in the call. Can't I define the parameter names programmatically? See the reproducible…
DeltaIV
  • 4,773
  • 12
  • 39
  • 86
1
vote
1 answer

nonlinear least squares in R when data are a function of parameters to be estimated

I'm currently migrating from matlab to R, and trying to find out if what I want to do is possible. I want to estimate a non-linear model in R where the observations are US states. The wrinkle is that one of the independent variables is a…
s.willis
  • 347
  • 2
  • 11
1
vote
0 answers

Fitting multiple parametric equations to curve using nls

I am trying to fit non parametric functions to curve using nls. When I try to fit all the parameters nls was not able to solve the equations. So, I split the equations and applied nls on individual equations and later again as a final fit Here is…
Shankar Pandala
  • 969
  • 2
  • 8
  • 28
1
vote
1 answer

NLS Curve Fit Singular matrix error

I need help fitting nls and finding initial estimates that would not lead to singular matrix. I will greatly appreciate any help. via_data$Concentration <- c(0.197, 0.398, 0.792, 1.575, 3.154, 6.270, 12.625, 25.277, …
Krina M
  • 135
  • 2
  • 13
1
vote
1 answer

Constraints for nls coefficients

I'm trying to fit data with nls() function where the nature of data gives me bounds for one coefficient and for sum of two coefficients. Let me introduce short example to see where is the problem. I want parameter b1 to be between 0 and 1 and I want…
Adela
  • 1,757
  • 19
  • 37
1
vote
0 answers

How to fit a model dependent on its own output with FME?

1. Objective + details I would like to find the optimal value for k. This optimal k is the one that minimizes the difference between observed (Deltaobs) and modeled (see equation below) data for 3 points in time (1950, 1993, 2014). Modeled data is…
user3262756
  • 649
  • 1
  • 9
  • 27
1
vote
0 answers

NotificationListenerService enabled but not live

use adb shell dumpsys notification The picture was found from web to explain my question. I have created a class which extends NotificationListenerService,but sometimes it doesn't work(I mean it can not receive notifications and do something) even…
孟照雪
  • 11
  • 4
1
vote
2 answers

how to get a geom_smooth for an nls assymptote function using SSasympOff

I have the following dataframe: df1<- structure(list(Site = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("ALT01"), class = "factor"), Nets = 1:18, Cumulative.spp = c(12L,13L, 15L, 17L, 17L, 17L,…
Derek Corcoran
  • 3,930
  • 2
  • 25
  • 54
1
vote
0 answers

Multiple variables with different relationships in nls() in R

I would like to build a model to predict Y based on several variables. First, I have a look on scatterplot and correlation map on R (see below) enter image description here It appears that Y has a exponential relationship with X1, a logistics growth…
henry
  • 23
  • 6
1
vote
0 answers

Non linear regression with groups by nlsList in R

Take the example of mtcars in R: I want to make a non linear regression for the relationship between mpg and disp for each cylinder and each group of vs. In my case I have a dataframe much bigger than mtcars. I know there is not enough data. But to…
Yang
  • 21
  • 1
1
vote
1 answer

non-numeric argument to binary operator error in nls

I am trying to run the following code but it gives me: Error in qr.default(.swts * attr(rhs, "gradient")) : NA/NaN/Inf in foreign function call (arg 1) In addition: Warning message: In log(.expr4) : NaNs produced Can you please help me…
13554N
  • 37
  • 9