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
1 answer

Why is the nls function returning such different values, for the same model, with similar datasets?

I have two sets of age and length data for the same fish species, both provided in the following link. And I would like to a fit growth model, using R, that allows for a change in the growth at a specific moment of the lifespan. I tried using the…
0
votes
1 answer

In nlsplot(), how to see the model equation in R?

I generated one data nitrogen<- c(0,40,80,120,160,260) yield <- c(8.4,9.8,10.8,12.5,11.1,12.7) dataA<- data.frame(nitrogen, yield) and I'd like to see this data as quadratic-plateau model. So I used nlsplot()…
Jin.w.Kim
  • 599
  • 1
  • 4
  • 15
0
votes
0 answers

non linear model seems to have a good fit but coefficients are all not significant

I'm running a nonlinear multiple regression with the nls_multstart() function with one dependent variable and three independent variables. this is my code: NLS.2 <- nls_multstart(micro~(a*b*rad_nee/(a+b*rad_nee))*(1+(A1*gfc)+(A2*vwc_nee)), …
Fra AdV
  • 1
  • 1
  • 3
0
votes
1 answer

Singular gradient in nls model - how can I make it work?

I have data, on which I want to fit a non-linear regression model. The model is a physical model to compute the Chlorid defusion coefficient. In my case the model looks like Cx = Ci + (Cs - Ci) * erfc(x / (sqrt(4 * D * t)) with Ci = 0.020664, t =…
stats_123
  • 3
  • 3
0
votes
0 answers

Non-linear least squares regression with two factors in R

I am trying to fit some data to a nonlinear least squares regression in R. I have two factors I would like to include in the model, one with two levels, and one with four levels. The one with two levels has a baseline level. However, I need all 4…
0
votes
1 answer

how to predict x given y for nls model?

I am using the nls SSlogis function in R to make a model expressing water absorption in a plant, where y=water absorption (g per m^2), and x=minutes in water. For a given y value (in this case max water absorption), I would like to solve for x (the…
treee
  • 13
  • 3
0
votes
1 answer

How to run an exponential decay mixed model?

I am not familiar with nonlinear regression and would appreciate some help with running an exponential decay model in R. Please see the graph for how the data looks like. My hunch is that an exponential model might be a good choice. I have one fixed…
0
votes
1 answer

How to draw a quadratic plateau in ggplot?

This is example of data and graph ##generated date GN<- c(1,2,3,4,5,6,7,8,9,10,11,12,13) Yield<- c(10,30,50,65,75,80,90,100,105,110,115,115,116) dataA<- data.frame(GN,Yield) ##ggplot ggplot(data=dataA, aes(x=GN, y=Yield))+ …
Jin.w.Kim
  • 599
  • 1
  • 4
  • 15
0
votes
0 answers

how can i resolve error non-numeric argument to binary operator

i was trying to generate parameter estimate for a nonlinear equation using r. i guess the starting points but i got the following error message: "error in exp^-((Ht - h5/(b1))) : non-numeric argument to binary operator" Ht and h5 are variables in…
T.awesome
  • 1
  • 2
0
votes
2 answers

Adding categorical control variables to nlsLM regression

I am trying to run an Nonlinear Least Squares regression to estimate three parameters while controlling for categorical variables. I am currently using the nlsLM function from the minpack.lm package for this. I have the following data set: df <-…
0
votes
0 answers

Nonlinear parameter estimation with nlme, with plot-level random coefficient

I'm trying to estimate a function with 3 parameters, whereof 2 (growth parameters b, v) are shared between all sites, and 1 (asymptote A) is specific to each site. nlme reports: Error in MEEM(object, conLin, control$niterEM) : Singularity in…
0
votes
1 answer

nls() returns different fittings on two similar sets of data (R)

Dear stack overflow community, I am trying to fit the Hill equation to some fluorescence induction curves (inducer vs fluorescence response). I have two types of data that both represent fluorescence response, I have dubbed them "max" and "rate". My…
0
votes
0 answers

nls model not showing the y0 table but the a and b

I am trying to get the nonlinear formula of y0, a, and b for my curve so I cam plot it on my graph. the summary(nls.mod) output does not show the y0 that I will need to plot the curve and I am not sure why as I have tried everything. The code is…
Abby
  • 1
  • 1
0
votes
0 answers

How do I add a line (calculated by a formula) to a scatter ggplot with grouped data in a loop?

I have a plot done outside of a loop that I want to do through a loop. The script for this plot is the following: #perform the fitting mm.nls <- nls(M2$rate ~ (Vmax * M2$conc / (Km + M2$conc)), data=M2, …
0
votes
1 answer

How can I extract, label and data.frame values from Console in a loop?

I made a nls loop and get values calculated in console. Now I want to extract those values, specify which values are from which group and put everything in a dataframe to continue working. my loop so far: for (i in seq_along(trtlist2)) { loopmm.nls…