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.
Questions tagged [non-linear-regression]
732 questions
6
votes
0 answers
Understanding the Jacobian output of scipy.optimize.minimize
I'm working with scipy.optimize.minimize to find the minimum of the RSS for a custom nonlinear function. I'll provide a simple linear example to illustrate what I am doing:
import numpy as np
from scipy import optimize
def response(X, b0, b1, b2):
…

khiner
- 411
- 5
- 7
6
votes
1 answer
nls() false convergence (despite good starting values)
I have been working on a curve fitting script which fits 3 exponentially modified Gaussians (EMGs) to a convolved curve. My base function is similar to a Gaussian distribution, but includes a third parameter (the first two being mu and sigma) which…

Ryan
- 203
- 2
- 9
5
votes
1 answer
Calculate and plot 95% confidence intervals of a generalised nonlinear model
I have built several generalised nonlinear least squares models (exponential decay) with the R package nlme and the contained gnls() function. The reason I do not simply build nonlinear least squares models with the base nls() function is because I…

Luka Seamus Wright
- 75
- 6
5
votes
1 answer
Show R2 and p-value in ggplot for y~log(x) fuction
I want to make a ggplot with a log regression and want to show the R2 and p-value.
I tried stat_cor, but it only shows R2 and p-value for a linear regression. I tried to incorporate "formula=y~log(x)" into stat_cor, but sais unknown parameter:…

Gloria Rooibos
- 51
- 1
- 2
5
votes
1 answer
finding a point on a sigmoidal curve in r
Here is a data set:
df <- data.frame('y' = c(81,67,54,49,41,25), 'x' =c(-50,-30,-10,10,30,50))
So far, I know how to fit a sigmoidal curve and display it on screen:
plot(df$y ~ df$x)
fit <- nls(y ~ SSlogis(x, Asym, xmid, scal), data =…

B C
- 318
- 3
- 16
5
votes
2 answers
Statistical tests: how do (perception; actual results; and next) interact?
What is the interaction between perception, outcome, and outlook?
I've brought them into categorical variables to [potentially] simplify things.
import pandas as pd
import numpy as np
high, size = 100, 20
df = pd.DataFrame({'perception':…

A T
- 13,008
- 21
- 97
- 158
5
votes
1 answer
Tensorflow. Nonlinear regression
I have these feature and label, that are not linear enough to be satisfied with linear solution. I trained SVR(kernel='rbf') model from sklearn, but now its time to do it with tensorflow, and its hard to say what one should write to achieve same or…

Grail Finder
- 635
- 2
- 7
- 21
5
votes
1 answer
Plot the median, confidence interval of a bootstrap output in ggplot2
I have a dataframe df (see below)
dput(df)
structure(list(x = c(49, 50, 51, 52, 53, 54, 55, 56, 1, 2, 3,
4, 5, 14, 15, 16, 17, 2, 3, 4, 5, 6, 10, 11, 3, 30, 64, 66, 67,
68, 69, 34, 35, 37, 39, 2, 17, 18, 99, 100, 102, 103, 67, 70,
…

SimonB
- 670
- 1
- 10
- 25
5
votes
1 answer
Programming language R: meaning of 'weights' parameter in library method 'loess'
I use the library method loess of the R programming language for non parametric data fitting. The dataset is two-dimensional. I have not found any proper documentation of the method parameter weights.
My data points are normally distributed random…

sperber
- 661
- 6
- 20
4
votes
1 answer
Least Squares Fitting/Power Fit - Why is my variable the wrong number
so I have to find the coefficients of this function.
https://mathworld.wolfram.com/LeastSquaresFittingPowerLaw.html
I think I input the equation for the variable "a" right, the answer should be around 8. But it keeps giving me an answer of around 2.…

silver-fang87
- 41
- 3
4
votes
1 answer
Import `pyearth` in Google Colab (`from pyearth import Earth` error)
I need to load the Multivariate Adaptive Regression Splines (MARS) algorithm from a library called pyearth on Google Colab. This is what I want to do:
# Import model from library
from pyearth import Earth
# Initialize model
reg = Earth()
However,…

Arturo Sbr
- 5,567
- 4
- 38
- 76
4
votes
1 answer
How to plot sigmoidal data in R - binary Y continuous X ggplot mixed effects logisitic regression
Here's the data I'm working with:
data <- data.frame(id = rep(1:3, each = 30),
intervention = rep(c("a","b"),each= 2, times=45),
area = rep(1:3, times=30),
"dv1" = rnorm(90, mean =10, sd=7),
"dv2" =…

myfatson
- 354
- 2
- 14
4
votes
1 answer
how to improve the quality of a nonlinear fit with python GEKKO?
I am working on a biochemical model: there is an enzyme that catalyzes twice a substrate. By naming:
* E = the enzyme
* S = the original substrate
* P = the intermediate product, which is in turn substrate
* F = the final product
I have this…

robyrobur
- 41
- 2
4
votes
1 answer
Non Linear Seemingly Unrelated Regressions (SUR) in R imposing restrictions
I'm trying to estimate a non-linear Seemingly Unrelated Regressions (SUR) model with 5 equations in R, and I was working over the package systemfit. Everything goes well until it needs to set some restrictions on my equations. using the package…

Ariel
- 395
- 1
- 14
4
votes
0 answers
Estimating parameters of exponential decay model where DVs are dependent on sum of different time-series in R
I would like to know how to proceed with the following non linear regression analysis, which is a simplified version of my real problem.
5 Participants where asked to observe the speed of three different cars: Audis, VWs and Porsches over a ten…

Jj Blevins
- 355
- 1
- 13