Questions tagged [nls]

`nls` is an R routine to fit nonlinear regression models of the form $y = f(x B) + e$

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

How can I transfer the exponential relationship to linear?

The exponential relationship between y and x I got is model_1 <- nls(y ~ I(a * exp(-b * x)), start = list(a = 1, b = 0), trace = TRUE) ...
1
vote
1answer
29 views

How to calculate time of day of the peak of a harmonic function fit from phase offset estimate from R nls

I'm trying to calculate the time of day of a harmonic function peak using nls() in R. I've looked at the posts here, here and here, but have not found a method to calculate time of day from phase ...
0
votes
0answers
12 views

NLS more consistent than GMM

I'm trying a simple code to test whether NLS has better performance than GMM. The R code looks like this ...
0
votes
0answers
21 views

Why SSgompertz does not work on similar data sets?

I have data that follows a sigmodial shape and the Gompertz function seem to make sense. I wanted to use SSgompertz in nls to find the parameters, but I get sometimes errors. So, I wanted to learn ...
0
votes
0answers
54 views

Start function issues using nls

I want to statistically compare two curve fitting from two different dataset : pA3 et pE5. They both follow sigmoid curves (I do not use high enough concentration of pA3 to see the lower plateau). So ...
0
votes
1answer
23 views

Fitting a non-linear least squares regression to estimate coefficients of parameters in R

I need to fit a non-linear least squares regression to estimate coefficients which are governed by an equation that have parameters obtained from generating data series. Data: ...
0
votes
0answers
20 views

Test for equal variance of residuals for Nonlinear Regression Models?

I obtain a residual plot against the fitted values and it does show some pattern for the residuals, so I suspect there may exists heteroskedasticity problem. Which kinds of test can be apply here to ...
0
votes
0answers
21 views

Get initial parameters for growth models with nls whith non-common functions like “Ricker2” or “Richards” functions

I usually fit the most commonly known growth models using the FSA library and with the function selfStart. Now, I am trying to test some models with the Original Gompretz vbFuns("Ricker2") ...
0
votes
1answer
33 views

Is a Google Sheets fit model a valid place to retrieve starting parameters for nls() in R Studio?

0 I am trying to fit an exponential model of form y = ae^(xb) in R to the data I have ran below, using the nls() function. I have read here and in other places that I need to feed the model reasonable ...
0
votes
0answers
28 views

Basic assumptions: Difference between the normality test in data and in the analysis of variance model

I have two situations that finish in a conceptual question. Linear models (lm) and non-linear models (nls) need to be normality assumptions, but what is the difference between the normality test in ...
3
votes
1answer
78 views

How to fit a piecewise assembly of nonlinear functions?

I am trying to model vegetation spectral signatures (grey lines) using a two-part piecewise function (black dotted lines). In it, I am trying to use only a few points (red dots) to fit a linear (first ...
0
votes
0answers
21 views

How to choose suitable nls models?

I'm trying to run nls models in two datasets using the sigmoid model, but the models are poor. How can I chose suitable models? The datasets are from n. animals harvested per species by 30 villages, ...
1
vote
0answers
68 views

using nls in R to fit a distribution to a model - constant error on multiple parameter estimate

I have a distribution of data (x), which I need to fit with a two-species, or three-species model (essentially the sum of two gamma distributions) to find D (the diffusion coefficient). A single-...
1
vote
1answer
99 views

NLS analysis in R with timeseries data to remove known effect

I have a timeseries dataset collected by sensors. The data is crack displacement (disp) and temperature (temp). Thermal ...
0
votes
0answers
14 views

estimating non linear function depending on 2 factors - possibly using gams

I have data like this and I already used a gam for geom smooth: Every scatter is for each month (first factor) and x is an integer. There is another 2 level factor. For one level the response is more ...
0
votes
1answer
28 views

fitting specific formula/model in r - model possibly not identifiable

I would like to fit the following formula in R: y ~ alpha *(x1_0 * x2_0 * beta_0 + x1_1 * x2_1 * beta_1) Here: alpha, ...
0
votes
0answers
18 views

fitting multiplicative non linear model in R

I have samples per month over several years (assuming stationary behavior). My data contains an independent variable: hours (representing available hours per month). The model to be fitted should ...
0
votes
0answers
14 views

Nonlinear regression with variables that are directly dependent on each other

I am performing a nonlinear regression analysis (with the nls function in r) to estimate the constant parameters for a proposed equation. My equation has 4 variables L, G, m, and S. G and S are not ...
6
votes
2answers
293 views

Interpreting and troubleshooting nls in R with quadratic plateau model

I am trying to run a quadratic plateau model on some proportion data where values are bound between 0 and 100. I would like some help troubleshooting some errors I have encountered, and correctly ...
1
vote
3answers
257 views

How do you compare linear model vs non-linear (nls) model in R?

I am trying to model some data, and as part of the modeling, I tried linear model (using lm function) and non-linear model (using nls) function. Model 1 : a linear model which has degrees of freedom ...
0
votes
0answers
364 views

Starting values for an nls model in R [duplicate]

I'm trying to fit an exponential model using nls, but I don't know how to select the starting values for the parameters. I know this question has been answered multiple times, but I spent some days ...
1
vote
1answer
82 views

Sine curve fit and model tunning using nls in R

I acquired data (motor adaptation =y in function of delays =t ) which I expect to look like a sine wave. I am trying (1) to fit a sine curve in my data and (2)to estimate the best model/parameters. I ...
0
votes
0answers
381 views

Sine curve fit using nls in R

I acquired data (motor adaptation $y$ as a function of delays $t$ ) which I expect to look like a sine wave. I am trying (1) to fit a sine curve in my data and (2) to estimate the best model/...
0
votes
0answers
18 views

Sine curve fit using lm, nls and nls2 in R [closed]

I acquired data (motor adaptation =y in function of delays =t ) which I expect to look like a sine wave. I am trying (1) to fit a sine curve in my data and (2)to estimate the best model/parameters. I ...
0
votes
1answer
227 views

Comparing time series data between three treatment groups (in R)

I have time series data where the response is decreasing over time. The rate of the decrease is supposed to depend on the treatment (the concentration of a drug). By looking at the data I am not sure ...
1
vote
0answers
42 views

r - Understand goodness of a fitted curve [duplicate]

I had to find the equation of curve that represent my data. After trying different function, I got a models that seems fitting my data, at least by plotting them. But this is it. I have no idea how to ...
0
votes
1answer
813 views
1
vote
1answer
211 views

Constraining parameters in NLS in R to be less than a value, or greater than a different value

The nls function in R comes with upper and lower arguments to specify the upper or lower ...
0
votes
0answers
34 views

Nonlinear fit in R only works with tightly restricting parameter bounds [duplicate]

I have a reproducible example here with an attempt to use nls to fit a nonlinear function: y = ax/(b+x) + c Even when I set the starting values to be a good, ...
0
votes
1answer
992 views

Singular gradient erros, NLS in R

I'm trying to fit nls(Mound~ a*kg.bag.collar^b + c, start = list(a = 83, b = -.5, c=100), data=test) using the dataset here. I've fit it without trouble without the ...
1
vote
0answers
672 views

NLS model comparisons by ANOVA

I am comparing NLS models from two groups, males and females. I compared the models by ANOVAs, but I am hesitating which is the correct model comparison to use: a) Subgroup Males vs Subgroup Females ...
0
votes
0answers
147 views

Trouble fitting my data with non-linear Regression model

I have a dataset that contains tree height and diameter measurements among the tree stem. I tried to fit my data with GNLS in R, but I'm getting this "step halving factor reduced below minimum in NLS ...
1
vote
0answers
19 views

Estimate the Beta Coefficients, and then find an algorithm

Referring to the photo, I need to report my beta coefficients as functions of observed Xi and Yi. I tried to reduce by taking the log of both sides but It seems I can't reduce this model because it is ...
0
votes
0answers
595 views

Initial conditions for nonlinear models using the nlsLM function

I have a data frame containing 70000 rows. For each row, I am trying to apply the nlsLM function (minpack.lm package) to find ...
0
votes
0answers
148 views

comparison of more than one multivariate nls models in r

dear members, I am trying to identify which of the two multivariate nls models is more of a good fit. I came to know that you can use anova and f tests for univariate nls models to know ...
1
vote
1answer
1k views

How to know if a parameter is statistically significant in a “curve_fit” estimation? [closed]

I use curve_fit from scipy to estimate parameter values from a specific function. ...
0
votes
0answers
82 views

Reproducing non-linear sigmaplot regression with nls()

I'm trying to reproduce a non-linear regression with various similar datasets. The original regressions were performed by sigmaplot with a modified morrison equation and estimates for parameters E=2,K=...
3
votes
0answers
3k views

How to fit exponential y=A(1-exp(B*X)) function to a given data set? Especially how to determine the initial start parameters? [duplicate]

I have a data set in which $y$ is roughly related to $\log(x)$. Now I wish to fit the curve $$y=A(1-\exp(BX))$$ When I use R and the nls2 function, then I ...
2
votes
0answers
256 views

Why do different parameterizations give different results for nls?

Goal I'm trying to fit a four-parameter logistic (A+(B-A)/(1+exp((xmid-input)/scal))) in R, using nls and SSfpl, to fit two datasets that share the upper, lower, ...
3
votes
1answer
2k views

Standard errors for non-linear least squares in R

I have a question on standard errors for non-linear least squares in R. With the built-in function NLS and a hand-made function I get different SE and I don't understand why. I will try to expose ...
4
votes
0answers
570 views

Fitting a sinusoidal curve only with max-min values

I have a series of high-low tide values, approx. every 6h, and each one has the corresponding time. I would like to get (an estimation of) the values between each record. I was thinking I could create ...
2
votes
1answer
3k views

Simultaneously curve fitting for 2 models with shared parameters in R

Hi I am trying to curve fit 2 models (Van Genuchten & Mualem) with shared parameters in r. The models are: ...
1
vote
1answer
317 views

Difference between probit of log(x) and probit using inverse lognormal cdf of x

Topic: probit and logprobit regression. Context: I have to implement a model of size at maturity in a wild population and I must choose a binomial linear model to estimate the parameters based on ...
2
votes
0answers
319 views

Bootstrapping of nonlinear regression residuals: why does the model fitting fail?

I am trying to define a range of uncertainty associated with each estimate of the parameters of a nonlinear model: ...
9
votes
2answers
9k views

Fitting exponential decay with negative y values

I am trying to fit an exponential decay function to y-values that become negative at high x-values, but am unable to configure my nls function correctly. Aim I ...
0
votes
1answer
360 views

Fitting a non linear equation to a dataset

I am working on fitting an equation from a dataset. In my dataset I have two variables where I am interested at and I looking a function that gives me the value the free variables that I use in the ...
5
votes
2answers
706 views

How to calculate p-value for a parameter given confidence interval when null hypothesis != 0

Given the dataset: ...
2
votes
1answer
1k views

Why is my nonlinear least squares confidence band so wide?

I have the following dataset: ...
2
votes
1answer
2k views

nls() gradient error in fitting growth curve data

I am trying to model the following data on promotional budget and customer awareness. The idea is, at some point, increase in budget doesn't have any further impact on awareness; it saturates. ...
1
vote
2answers
2k views

nls() function in R not fitting well when calculating Kd

I'm trying to calculate Kd with the following R code but my model is clearly wrong (see image). How has nls() converged so poorly? How can I use it to find a better ...