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

NLS Function By Group

I have a dataset where I want to apply non linear least squares by group. This is a continuation to my previous question: NLS Function - Number of Iterations Exceeds max The dataset looks like this: df x y GRP 0 0 1 426 9.28…
nak5120
  • 4,089
  • 4
  • 35
  • 94
1
vote
1 answer

NLS Function - Number of Iterations Exceeds max

I have a dataset that looks like this: dput(testing1) structure(list(x = c(0, 426.263081392053, 852.526162784105, 1278.78924417616, 1705.05232556821, 2131.31540696026, 2557.57848835232, 2983.84156974437, 3410.10465113642, 3836.36773252847,…
nak5120
  • 4,089
  • 4
  • 35
  • 94
1
vote
1 answer

How to calculate confidence interval of adstock rate calculated using nls function in R?

I have calculated adstock rate for TV GRP using nls function of R. I have used below code to calculate it: # Adstock function adstock <- function(inp_x, rate=0){ return(as.numeric(stats::filter(x= inp_x, filter=rate,…
Ankita Patnaik
  • 271
  • 1
  • 7
1
vote
1 answer

Skipping errors in data table computation using nls

This question builds off a previous one I asked here Exponential curve fitting with nls using data.table groups. I am fitting exponential curves using nls to a data table object by multiple groups. Not all of the data appears to fit an exponential…
Justin
  • 37
  • 2
1
vote
1 answer

Exponential curve fitting with nls using data.table groups

I'd like to fit exponential curves to groups 1 & 2 in the data table shown below and obtain a new column containing the residual standard error corresponding to each group. The exponential curve should follow y=a*exp(b*x)+c ## Example data table DT…
Justin
  • 37
  • 2
1
vote
1 answer

nlsTracePlot returns "is not a function" - how to solve this issue?(R)

I have a dataframe, with ### create sample data set.seed(1) x = runif(n = 100, 0, 20) beta1 = 2 beta2 = 1 beta3 = (1/2) ### Create sample data frame and vector y = beta1 + beta2*x^(beta3) + rnorm(n = 100, 0, 0.01) data =…
Serkan
  • 1,855
  • 6
  • 20
1
vote
0 answers

How to close the gap between summarized predicted data and monthly truth data.

This question is somewhat of a follow up question to an earlier one I had here: R: Summarize inside an nlsLM() statement With the answer supplied, I am able to make appropriate minutely predictions when only given monthly data. However, this being…
obewanjacobi
  • 458
  • 2
  • 12
1
vote
1 answer

How can i fit a power curve from a non-linear regression?

I am trying to fit a curve following a non-linear regression. Here is my dataset: stem_diameter <- c(15, 15, 16, 17, 19, 23, 23, 24, 24, 25, 25, 26, 27, 28, 29, 30, 30, 32, 32, 33, 34, 34, 35, 36, 36, 37, 38, 40, 41, 41, 42, 42, 46, 48, 48, 49, 51,…
G Jones
  • 43
  • 4
1
vote
1 answer

R : Robust nonlinear least squares fitting of three-phase linear model with confidence & prediction intervals

I would like to fit a monotonically increasing three-phase linear model using nls in R. Say I have data y <- c(4.5,4.3,2.57,4.40,4.52,1.39,4.15,3.55,2.49,4.27,4.42,4.10,2.21,2.90,1.42,1.50,1.45,1.7,4.6,3.8,1.9) x <-…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
1
vote
1 answer

Extrapolation in R

I have a reference data set, p, p=structure(list(v = 0:26, t = c(Inf, 1.016, 0.568, 0.418666666666667, 0.344, 0.2992, 0.269333333333333, 0.248, 0.232, 0.219555555555556, 0.2096, 0.201454545454545, 0.194666666666667, 0.188923076923077, 0.184,…
Haribo
  • 2,071
  • 17
  • 37
1
vote
1 answer

Oracle Matrix for AL32UTF8 characterset

Using the DUMP command within Oracle, it produces the following : SQL> select dump(field1, 1016) from test_nls; Typ=1 Len=8 CharacterSet=AL32UTF8: c3,bd,c3,a3,c3,a1,c3,b6 Is there a AL32UTF8 matrix of sort out there where I can compare the two…
Unhandled Exception
  • 1,427
  • 14
  • 30
1
vote
4 answers

Oracle - Change start day of Week - Tuesday

I want to change the start day of week in Oracle, and I need to calculate some reports for each week from daily/hourly data. Through lot of Google search I got only NLS_TERROTORY option, from which I don't know how to set to TUESDAY. Even if there…
Ram
  • 845
  • 1
  • 13
  • 26
1
vote
2 answers

Oracle 10g NLS Parameters

Could people please let me know if there are any issues with setting Oracle 10g NLS Parameters at database level, specifically the NLS_TERRITORY to the country I am in together with setting the timezone to UTC. Will there be any conflicts b/c as the…
tonyf
  • 34,479
  • 49
  • 157
  • 246
1
vote
1 answer

How can I use nsl(function) in R to find parameters of a model?

I've got the following: x <- c(549.9 , 400 , 325.9 , 250.2 , 200.1 , 150 , 120 , 79.92 , 39.96) y <- c(5.748 , 3.50152 , 2.70204 , 2.54265 , 2.52241 , 1.35861 , 1.377444444 , 1.279055556 , 1.05501) nls(y ~ A + B*(x^C)) I haven't managed to make…
Gilmar Neves
  • 37
  • 10
1
vote
2 answers

Using nls and ggplot2 to fit a logarithmic curve to data

I am using R to fit data on a logarithmic curve with equation: y = a * log(b * x) My data looks like this: #Creating example data pre <- c(946116, 1243227, 1259646, 1434124, 1575268, 2192526, 3252832, 6076519) post <- c(907355, 1553586, 1684253,…
hemicellulose