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
2 answers

Issue with date format output in Oracle

I have a requirement where I have to insert date fields into a varchar column. I am directly inserting the record into the table without any typecast. In one environment it's inserting as 29-AUG-16, and in the other environment it's storing as…
Sid
  • 582
  • 3
  • 7
  • 28
0
votes
1 answer

Approach for comparing linear, non-linear and different parameterization non-linear models

I search for one approach for comparing linear, non-linear and different parameterization non-linear models. For this: #Packages library(nls2) library(minpack.lm) # Data set - Diameter in function of Feature and…
Leprechault
  • 1,531
  • 12
  • 28
0
votes
0 answers

PL/SQL developer returns question marks instead of special characters

Hi im having a problem with PL/SQL Developer only returning question marks, Its happens all the time unless i connect to another server through dblink, then it is able to return Danish letters or special characters like '£'. But whenever i run SQL…
EclecticFish
  • 53
  • 1
  • 10
0
votes
1 answer

nls() : "Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates "

I'm trying to use nls(), but I keep getting the error Error in nlsModel(formula, mf, start, wts) : singular gradient matrix at initial parameter estimates and I'm not sure where the problem is. Code below: TI <- c(0.5, 2, 5, 10, 30) prices <-…
Chris A.
  • 369
  • 2
  • 14
0
votes
0 answers

False parameter estimates with NLS in R - why is this the case?

I am trying to fit two sales diffusion models on sales data of two consecutive product generations. Ultimately, I need to fit the models to determine the optimal launch timing of the second product generation, retrospectively. The models are defined…
0
votes
1 answer

Parameters bootstrap problem with optim() function for nls model

I've like to use optim() in my nls model, but doen't work. In my example: Fisrt I create a data set library(nls2) #Data set 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,…
Leprechault
  • 1,531
  • 12
  • 28
0
votes
0 answers

Differences in ^ and exp() notation in nls models

I' ve like to understand the differences in ^ and exp() notation in nls models. In my example: library(nls2) #Data set 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,…
Leprechault
  • 1,531
  • 12
  • 28
0
votes
1 answer

linear model for starting paramerters in nls fit

I read about using the log as an alternative for creating a linear equation so that I can extract starting values for an nls fit from the linear equation, in R; Accordingly, For equation: Y=q/(1+bDX)^(1/b) where Y and X are my data; q,b,D are my…
AKx
  • 41
  • 5
0
votes
0 answers

Non-linear regression with nested user defined functions using nls and nlr

I've been trying to perform a nonlinear regression using the fuctions nls and nlr from gnlm package but my objective function has many adjustable parameters and is easier to define it by defining a bunch of different equations first. So, I've got…
Sofia
  • 21
  • 3
0
votes
1 answer

Simplifying R code when fitting data (for loops)

I have working code to accomplish my goal, but as you will see it is not very elegant. I've tried writing it with for loops but my coding knowledge is relatively basic. Could some generous person help me simplify my code and hopefully annotate it so…
0
votes
1 answer

fit weibull modified in R 3 parameter

I want to fit the following data to a Weibull distribution multiplied by a. datos: enter link description here y=b1*(1-exp(-(x/b2)^b3) However, I could not find a solution using the nls function in R. Could someone guide…
EBT
  • 17
  • 4
0
votes
1 answer

R: determining coefficients for nls

I am trying to fit this nonlinear model in R using the nls function. Here is the data I am trying to fit: tab2 = data.frame(n = c(10,100,1000,10000,100000), Time = c(3.989220e-03, 1.994681e-02, 3.311172e-01, 5.142252e+00, 1.314725e+03)) We see…
akenny430
  • 305
  • 3
  • 16
0
votes
2 answers

Start list of parameters for nls and rational function

I would like to fit a rational function to my data: data: [1] 2.000000 3.000000 2.333333 1.750000 2.000000 1.833333 2.416667 1.916667 [9] 1.750000 2.166667 2.116667 1.916667 1.944444 1.611111 1.722222 1.777778 [17] 1.877778 1.944444 1.958333…
NewUsr_stat
  • 2,351
  • 5
  • 28
  • 38
0
votes
1 answer

Non-linear regression vs log model

library(ggplot2) dat <- structure(list(y = c(52L, 63L, 59L, 58L, 57L, 54L, 27L, 20L, 15L, 27L, 27L, 26L, 70L, 70L, 70L, 70L, 70L, 70L, 45L, 42L, 41L, 55L, 45L, 39L, 51L, 64L, 57L, 39L, 59L, 37L, 44L, 44L, 38L, 57L, 50L,…
89_Simple
  • 3,393
  • 3
  • 39
  • 94
0
votes
0 answers

using nls function in R

I want to use nls to fit an exponential function to my data : X <- c(0:40) Y <- c(0, 0.007515662, 0.015878514, 0.024994325, 0.034728341, 0.044910579, 0.055344590, 0.065818599, 0.076118441, 0.086040566, 0.095403934, 0.104059903, 0.111898792,…
Haribo
  • 2,071
  • 17
  • 37