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.
To perform this, Non-Linear Least Square approach is used to minimize the total sum of squares of residual values or error values i.e., the difference between vertical points on the graph from regression line and will fit the non-linear function accordingly.
r is residual or error value between 2 points.
Above mathematical function to find minimum residual function can be performed in R using
Regression analysis is widely used in all types of business issues to perform a smart decision or predicting the future by altering a factor of their business.
In R language, Non-linear Least Square function is represented as –
formula indicates the model formula i.e., non-linear function
start is a list of starting estimates
Note: To know about more optional parameters of nls(), use below command in R console –help("nls")
Example 1 :
In this example, a non-linear function is taken and plotted on the graph as points.
Example 2 :
In this example, below code is accepting a non-linear function as shown:
Further plotting the points and regression line and also, finding out the goodness of fit also by using cor() method.
 0.9622681  108.1481
- How Specify Length and Width of Square Grid Picture System in Bootstrap?
- How to Specify Divider gap in Square Grid using Bootstrap ?
- Calculate Square root of a number in R Language - sqrt() Function
- Chi-Square Test in R
- Compute Chi Square Density in R Programming - dchisq() Function
- Compute Cumulative Chi Square Density in R Programming - pchisq() Function
- Compute Randomly Drawn Chi Square Density in R Programming - rchisq() Function
- Compute value of Quantile Chi Square Density in R Programming - qchisq() Function
- Root-Mean-Square Error in R Programming
- Theorem - The tangent at any point of a circle is perpendicular to the radius through the point of contact - Circles | Class 10 Maths
- Linear Equations in One Variable
- Distance formula - Coordinate Geometry | Class 10 Maths
- Section formula – Internal and External Division | Coordinate Geometry
- Algebraic Expressions and Identities | Class 8 Maths
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.