We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0answers
7 views

Shared parameters similar to stats::nls() using “[]” but for minpack.lm::nlsLM() or similar?

I am looking for a method similar to the very convenient "[]" notation in stats::nls(), for estimating certain parameters separately (while sharing others) for subgroups within my data, which works ...
1
vote
0answers
38 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
88 views
1
vote
1answer
44 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
25 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
209 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
163 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
42 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 ...
0
votes
0answers
23 views

Hypothesis testing for nlsList fitted coefficients

I am trying to test in R if the coefficient R10 (soil respiration at 10 °C) is significantly different between two plant types (Type1 and Type2). For this, I fitted a modified Lloyd-Taylor function ...
1
vote
0answers
17 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
201 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
29 views

How to perform joint estimation of parameters from two NLS-regressions in R?

First of all, I am new to the board so excuse me if I am not writing this post in the most optimal way. That aside, I am trying to run some models on optimal entry timing for successive product/...
0
votes
0answers
61 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
684 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
52 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
997 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
203 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, ...
2
votes
1answer
613 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 ...
2
votes
0answers
353 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 ...
1
vote
1answer
1k 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
176 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
154 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: ...
0
votes
1answer
302 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 ...
4
votes
2answers
535 views

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

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

Why is my nonlinear least squares confidence band so wide?

I have the following dataset: ...
2
votes
1answer
1k 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
1k 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 ...
1
vote
1answer
267 views

Calibration of a computer code: how to deal with parameter vectors such that for some data points the code doesn't converge

I have an experimental data set $D=\{\mathbf{x}_i,y_i\}_{i=1}^N$, and a computer code with inputs $\mathbf{x}$ and calibration parameters $\boldsymbol{\theta}$, returning a value $s=f(\mathbf{x},\...
1
vote
1answer
346 views

How can I combine NLS models in a way as is done with linear regression models in Path Analysis

I have a structural equation model that includes several paths that are actually non-linear (built in with the lavaan package for R). I have used polynomials in order to model these non-linear paths. ...
0
votes
0answers
485 views

Curve fitting - linear vs non-linear

Dose Survival 1.044316 0.7085001 2.017041 0.2764831 3.042148 0.1498388 4.058954 0.0451514 5.098904 0.0145274 I have two models to fit the data: ...
0
votes
1answer
815 views

Fitting LPPL model using R

apologies if this appears too simplistic/poorly worded a question, this is my first time coding in R I am attempting to fit the LPPL model to a price series in order to test for its predictive power ...
7
votes
1answer
2k views

nonlinear least squares versus maximum likelihood in R, nls() or nlm()?

I am estimating the model $$E(Y|X) = Pr(Y=1|X) = \alpha_0 + (1 - \alpha_0 - \alpha_1)\phi(X'\beta),$$ where $\alpha_0$ and $\alpha_1$ are parameters, $\beta$ is a $p$-length vector of parameters, $X$ ...
3
votes
1answer
976 views

Comparing two models using anova

I have following two models (fit1, fit2) estimated using nls approach. I want to compare their goodness using anova, and the results follows: ...
2
votes
1answer
520 views

I used the function SSfpl (in R) for finding out the correct initial parameters. Why aren't they right?

This is my data: I used SSfpl for finding out the correct initial parameters nls(y~ SSfpl (-x, b1,b2,b3,b4), data=estatus) And with these initial parameters, I used nls(y~b1 + ((b2-b1)/(1 + exp(...
0
votes
0answers
122 views

What do the parameters A, B, and C do in an equation of the form $Y = A + Be^{CX}$? [duplicate]

I have read this article and those linked to it, but I am still having difficulties fitting a function of this form to data I have using the nls function in R. Invariably, I fail to get convergence ...
0
votes
0answers
866 views

how does nls model work?

I am trying to understand how nls model works. Let's say I have data frame mtcars and like to do this: model<-nls(mpg~disp) but getting this error: ...
1
vote
2answers
4k views

Fitting a function with R

I want to fit a function to these data: ...
1
vote
1answer
695 views

4th parameter of Boltzmann sigmoid must be greater than .9 in R

I'm trying to fit a 4 parameter boltzmann sigmoid and get an error: "Error in nls(y ~ a0 + (a1 - a0)/(1 + exp((a2 - x)/a3)), start = list(a0 = max(y), : singular gradient" I have figured out that ...
0
votes
1answer
121 views

Debugging in R when using nls

How to correct a nls estimator when I get an error message that: step factor 0.000488281 reduced below 'minFactor' of 0.000976562 The full problem: ...
0
votes
1answer
455 views

Why do the predictions of a linear (log-log) model not approximate those of a nonlinear (power) model?

I am having trouble using a linear (log-log) model to approximate the predictions of a nonlinear (power) model. I wish to plot the predictions of the linear model on untransformed axes, and I believe ...
0
votes
1answer
318 views

Testing difference between two non linear growth curves

I would like to identify the significance of the difference between two growth curves with the same formula but different parameters. The dummy data generated by the code produces a normal spread of ...
4
votes
1answer
180 views

Regression with restrictions like b1/b2 = q

My first question on this excellent forum that has already helped me many times. Here is my problem. I want to estimate the effect of a large number (c. 900) of independent events that are ...
11
votes
4answers
20k views

Getting the right starting values for an nls model in R

I'm trying to fit a simple power law model to a data set that is as follows: mydf: ...
2
votes
0answers
212 views

Problems in finding outliers and leverage points in non-linear regression

I'm implementing diagnostic of non-linear regression model $(y=ax^b)$. I'm trying to find out where outliers and leverage points in my model ...
0
votes
0answers
12 views

Using a model with domain/image constraints [duplicate]

I would like to fit a model and the smallest predicted value must be zero. This is what I have done: ...
1
vote
1answer
1k views

Fiting non-linear model to small data set

I want to do a small example with fitting non-linear model Here are data: x <- c(10, 15, 25) y <- c(5, 10, 15) Firstly I fit a second degree polynom: <...
1
vote
1answer
748 views

Non linear regression - Von Bertalanffy Growth Function - Error: “singular gradient matrix at initial parameter estimates”

I am trying to estimate VBGF parameters K and Linf using non linear regression and nls(). First I used a classic approach where I estimate both parameters together as below with "alkdyr" being a ...
7
votes
1answer
9k views

How to fit piecewise constant (or step-function) model and compare to logistic model in R

I have x, y data where x is position (along a transect) and y is a continuous variable (e.g. temperature). ...
2
votes
0answers
218 views

Using nls To Model

I'm trying to use nls model certain curves that I found in a dataset. I'm not sure how I can give example data, but here are the curves as they look right now: I tried using ...
0
votes
1answer
657 views

Difference between SAS and R results - Nonlinear Regression

Hoping someone can assist with this rather niche question. I have a routine built in R for analysing depreciation curves, which is fit according to a logistic model with an additional additive ...