Nonlinear Model
Nonlinear Model
Non linear regression is used to show the association between response and predictor variable. It is an
extended of linear regression model.
Non - linear regression models have at least one parameter in a dataset as a nonlinear.
Non-Linear regression is a type of polynomial regression. It is a method to model a non -linear
relationship between the dependent and independent variables. It is used in place when the data shows
a curvy trend, and linear regression would not produce very accurate results when compared to non-
linear regression. This is because in linear regression it is pre-assumed that the data is linear.
In non-linear function, the points plotted on the graph are not linear and thus, do not give a curve or
line on the graph. So, non-linear regression analysis is used to alter the parameters of the function to
obtain a curve or regression line that is closed to your data.
Mathematical Formula:
where,
r is residual or error value between 2 points.
Example
We will consider a nonlinear model with assumption of initial values of its coefficients. Next we will
see what is the confidence intervals of these assumed values so that we can judge how well these values
fir into the model.
So let's consider the below equation for this purpose −
a = b1*x^2+b2
Let's assume the initial coefficients to be 1 and 3 and fit these values into nls() function.
# Plot the chart with new data by fitting it to a prediction from 100 data points.
new.data <- data.frame(xvalues = seq(min(xvalues),max(xvalues),len = 100))
lines(new.data$xvalues,predict(model,newdata = new.data))