Questions tagged [non-linear-regression]

In statistics, nonlinear regression is a form of regression analysis in which observations are modeled by a function which is a nonlinear combination of the model parameters and depends on one or more independent variables.

732 questions
2
votes
0 answers

How do I find the equation from an lm() function r?

I am using the lm() to fit a curve to a set of data. Using the fitted model, I would like to find the equation so that I can apply it to my larger data set, however, I am unable to arrive at the correct equation. I have used the lm() function…
Kriddie
  • 21
  • 1
2
votes
0 answers

How can I automatically assign the formula to each nonlinear fit graph?

I try to analyze the linear fitting relationship of different couples, but I can't set the automatic adjustment of the nonlinear curve and the corresponding formula according to the situation of each couple. The original data is…
Chouette
  • 153
  • 7
2
votes
2 answers

How to obtain the estimated parameters from `nls`

I have the following data: x <- 0:10 y <- c(1, 0.0296734797447216, -0.115268522114696, 0.0685634237231258, 0.0462346454015914, 0.016874511238053, -0.00870738489741311, 0.0356310001815887, 0.0558631035027085, -0.116810154142989,…
Mark
  • 1,577
  • 16
  • 43
2
votes
2 answers

Multi-input single output regression using Scikit neural networks MLPRegressor

I have a 2D-array data as follows (with M & C as independent variables): Data I'm trying to model this regression (f(M,C) = y) using the Scikit MLPRegressor. Not knowing how to go about modeling multivariable input, I tried modeling it as two…
2
votes
1 answer

What method and tool for regression analysis for a multimodal distribution in R?

I have a set of variables X1 and X2 and Y with relationship plot as shown below. X2 values are used for color coding. X1, X2, and X3 are integer variables. The observed pattern is multimodal. What is the best way to predict Y based on X1 and…
vp_050
  • 583
  • 2
  • 4
  • 16
2
votes
1 answer

How to extract values of regression curve in R?

How to extract the x- and y-values of a regression curve in R? Generate some example data and combine in data frame: x <- c(54, 54, 54, 54, 54, 54, 54, 72, 72, 72, 90, 90, 90, 90, 90, 90, 90, 90, 90, 72, 72, 72, 72, 72, 54, …
SophiaL
  • 61
  • 7
2
votes
2 answers

How to do negative binomial regression with the rms package in R?

How can I use the rms package in R to execute a negative binomial regression? (I originally posted this question on Statistics SE, but it was closed apparently because it is a better fit here.) With the MASS package, I use the glm.nb function, but I…
Tripartio
  • 1,955
  • 1
  • 24
  • 29
2
votes
0 answers

Python: lmfit : shgo does not accept minimizer_kwargs

We are trying to find the global optimum of a minimisation problem. We have tried the basin hopping and shgo (simplicial homology global optimization) algorithm from scipy via the lmfit 'interface'. Using basin hopping, we can succesfully converge…
2
votes
0 answers

Why do Neural Networks Have such a hard time on sine wave regression

I have being experimenting with different kinds of ANNs to do regression on basic and increasingly more complex functions. It seems, to me though that I cannot get my network to learn cyclic functions like a sine wave. I read on the web and on this…
2
votes
1 answer

Constrained multi-variable non-linear regression using gekko

I am trying to constrain multi-variable non-linear regression using gekko. I constrained parameters c[i], but can't constrain part of function having both parameters and variables. Basically, 0 < c[i](xd[10]**c[10])(xd[11]**(c[11]+c[12]*xd[12])) < 1…
2
votes
1 answer

Plotting Polynomial Regression Curves in R

I have run polynomial regressions on the data that I am including from Quadratic to Septic but I am stuck trying to plot these regression curves on my scatter plot. I am asking for help creating code that will work for each polynomial order. Time <-…
Ben G.
  • 35
  • 4
2
votes
2 answers

Question on nls fit in R - why is this such a strange fit?

I'm trying to perform a non linear fit to some simple data (corn yield by year). It's straight forward enough to do it with lm in R, but some of the data would fit better if there was a curve allowed, something on the order of year^1.5 or so. x <-…
user8229029
  • 883
  • 9
  • 21
2
votes
2 answers

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

I am trying to fit an exponential model of form y = a*e^(x*b) 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 parameters for a and b, but the way about…
Cameron
  • 164
  • 14
2
votes
0 answers

Draw restrictive cubic spline diagram of linear regression in r

I am trying to use ols in rms package to fit the restrictive cubic spline of linear regression. But I don't know how to use ggplot to draw the restrictive cubic spline diagram of the regression coefficient? Like the picture: And anyone can help me…
LuengJun
  • 21
  • 1
2
votes
1 answer

Cannot install tsDyn package in RStudio, 'mnormt' doesn't exist

I am trying to install the tsDyn package on my Macbook Pro running MacOSX Catalina version 10.15.2. in RStudio (v.1.3.959), running R (v.4.0.1). I get the following error: ERROR: compilation failed for package ‘mnormt’ * removing…