Tagged Questions

nls is an R routine to fit linear regression models of the form y = f(xB) + e

learn more… | top users | synonyms

0
votes
0answers
19 views

cvFit mean predicted error interpretation for nls models

I have been using the cvFit() function of the cvTools library in order to test my models (nls() ones), but I would like to know more precisely what the cvFit() returns to me when it's done. It only ...
0
votes
0answers
28 views

nls standard deviation calculation

I have fitted a non linear assymptotic equation to a set of data and my interest is in getting the standard deviations of the fitted parameters. Is this possible in nls?
3
votes
2answers
67 views

R - how to get standard error for a breakpoint/parameter in a piecewise regression

I'm new to asking questions here, so I hope this is a reasonable place for this. I am trying to fit a piece-wise regression. I expect my response (y) to increase from x0 to somewhere along x, then to ...
0
votes
0answers
37 views

How to run an nls model in R to generate output parameters for independent categories?

I would like to get help on the following code: library(nlme) funct1 <- function(scale1,a){ exp((scale1 - 2)/a) } ...
0
votes
0answers
34 views

How to set up the initial data in the nls model

I am struggling with nls model given below. I have a blur idea how to set up the initial values in it. Shall I use "try and error" method or is there any other way to make it more systematic. ...
1
vote
0answers
54 views

studentized residuals in nonlinear regression

I am using the nls function in R to perform a nonlinear regression and need to calculate the studentized residuals. Is this something I need to manually do? It seems like I need to manually do a QR ...
2
votes
1answer
47 views

nls curve fitting of shared parameters

I have data for 5 replicates that were drawn from the same model and I want to fit all 5 replicates together so that I can find out the shared parameters. Specifically, if I have the underlying ...
1
vote
1answer
35 views

divergence between nls (simple power equation) on non-transformed data and lm on log transformed data in R

I'm testing different ways to fit a simple power model to a dataset of 5 points. I don't get same results if I use nls on non-transformed data or lm on log10 transformed data in R whereas Excel ...
2
votes
1answer
63 views

how to fit a michaelis-menten function with a random effect using the nlme package in R?

I am working on fitting a model using the nlme package in R. y is a saturating function of x, similar in form to a ...
2
votes
0answers
82 views

Calculating standard error of a coefficient that is calculated from other estimated coefficient

I'm working on the Gompertz growth model to fit weight at age: $$ m(a)=m_{\infty}e^{-\gamma exp(-g{1}a)}$$ Where $m_{\infty}$ and $g_{1}$ are coefficients to be estimated. To deal with lack of ...
1
vote
1answer
127 views

Fitting NLS algorithm

I have the list of time series. I am fitting these series with the formula $$y=ax^2\exp(b*x)$$. It should be noted that parameter $b$ in the formula must be negative as this reflects the behaviour of ...
0
votes
2answers
409 views

Using nls() function in R for exponential function

I know that this issue was already discussed here but I faced with the problem I can't solve. I have list of persons, each represented with some time series consisting from 4-8 points. I want to ...
4
votes
1answer
197 views

Is AIC appropriate for model selection when the parameters are fitted by least-squares rather than MLE

I want to compare the fit of a linear model (M1) and nonlinear model (M2): M1: $y = b_0 + b_1x_1 + b_2x_2 + b_3x_1x_2 + \epsilon, \epsilon \sim N(0, \sigma^2)$ M2: $y = b_0 + b_1x_1 + b_2x_2 + b_1 ...
4
votes
0answers
1k views

Fitting a “sigmoid” function: Why is my fit so bad?

I tried to fit a curve to the black points using the following code. Why is the fit so bad? Do I need to fit another type of function? ...
1
vote
0answers
73 views

How to calculate Pareto parameters

I'm trying to calculate the parameters for a Pareto distributed variable in R. I use the following model: form = rank~bet*(downloads)^(-alp)+eps, which is widely ...
4
votes
0answers
97 views

Numerical properties of the logistic growth model for non-linear regression

I am using the nls procedure in R to fit a logistic growth model. In their SSlogis function, José Pinheiro and Douglas Bates chose the formulation ...
2
votes
1answer
48 views

How do I incorporate 2 peaks in a liquidity model using curve-fitting and nls

This is my first time at stack exchange, hence please pardon me if I miss something. I have multiple questions and I am tearing myself as curve-fitting and estimation is foreign land to me, I am ready ...
2
votes
0answers
735 views

Non-linear modelling with several variables including a categorical variable

I am trying to model some data regarding a predator prey interaction experiment (n=26). Predation rate is my response variable and I have 4 explanatory variables: predator density (1,2,3,4 5), ...
4
votes
1answer
695 views

How to calculate confidence intervals for power function ($y=ax^b$) in R using NLS

I hope you can help me get some confidence in my confidence interval... I am trying to get the confidence interval for a particular (threshold) point on a predicted curve. I find the confidence ...
2
votes
1answer
654 views

nls curve fitting of nested/shared parameters

I'm trying to fit raw data to curves, which works well on an individual basis. However, I'd like to "share" parameters (sometimes referred as nested parameters) across more than one data series. Is ...
3
votes
0answers
357 views

Bayesian model averaging in R

I have a logistic model that I've built with the nls function in R. I want to use Bayesian model averaging for variable selection, but I can't find a package for ...
8
votes
1answer
981 views

Choose best model between logit, probit and nls

I'm analyzing a certain dataset, and I need to understand how to choose the best model that fits my data. I'm using R. An example of data I have is the following: ...
11
votes
1answer
2k views

How to minimize residual sum of squares of an exponential fit?

I have the following data and would like to fit a negative exponential growth model to it: ...
7
votes
1answer
1k views

How to test the effect of a grouping variable with a non-linear model?

I have a question regarding the use of a grouping variable in a non-linear model. Since the nls() function does not allow for factor variables, I have been struggling to figure out if one can test the ...
3
votes
1answer
1k views

How to get p value and confidence intervals for nls functions?

I have 2 questions. 1) How can I have p.value for my 2 functions? My hypothesis is that I have a correlation between my function and my data. 2) How can I have a confidence intervals for my 2 ...
5
votes
2answers
5k views

Singular gradient error in nls with correct starting values

I'm trying to fit a line+exponential curve to some data. As a start, I tried to do this on some artificial data. The function is: $$y=a+b\cdot r^{(x-m)}+c\cdot x$$ It is effectively an exponential ...
4
votes
1answer
619 views

Fitting conditional functions in nls

I'm trying to fit two equations with nls() function in R. The two functions are: $f(x) = c_{1} \exp\left(-\left(\frac{x-\mu}{\sigma_{(x)}}\right)^2\right)$ where $\sigma_{(x)} = \sigma_{11}$ if ...
12
votes
1answer
1k views

Change point analysis using R's nls()

I'm trying to implement a "change point" analysis, or a multiphase regression using nls() in R. Here's some fake data I've made. The formula I want to use to fit ...