Non-Linear Regression with Brute Force

Non-Linear Regression with Brute Force

2024-07-14 | G. Grothendieck, R Core Team (nls)
The 'nls2' package provides a function for estimating nonlinear model parameters using nonlinear least squares. It extends the functionality of the 'nls' function by allowing more flexible starting values and algorithms. The 'nls2' function can use various algorithms such as 'brute-force', 'random-search', 'lhs' (Latin Hypercube Sampling), and 'CPoptim' for optimization. It also supports a new 'all' argument that returns a list of 'nls' objects for each starting value if set to TRUE. The 'start' argument can be a two-row data frame, a data frame with more than two rows, or an 'nls' object. If it is a two-row data frame, 'nls2' generates a grid or random points within the defined rectangle. If it is a data frame with more than two rows, it runs an optimization for each row. The 'algorithm' parameter determines the method used for generating starting values and performing the optimization. The 'nls2' function can also use the 'CPoptim' algorithm, which requires a two-row data frame with lower and upper bounds for parameters. The function uses the 'nls' function to generate starting values, so 'confint' cannot be used on the resulting objects. Examples demonstrate the use of 'nls2' with different algorithms and starting values, including brute-force search, random search, and linear methods. The package is useful for nonlinear regression and provides more flexibility in choosing starting values and optimization methods.The 'nls2' package provides a function for estimating nonlinear model parameters using nonlinear least squares. It extends the functionality of the 'nls' function by allowing more flexible starting values and algorithms. The 'nls2' function can use various algorithms such as 'brute-force', 'random-search', 'lhs' (Latin Hypercube Sampling), and 'CPoptim' for optimization. It also supports a new 'all' argument that returns a list of 'nls' objects for each starting value if set to TRUE. The 'start' argument can be a two-row data frame, a data frame with more than two rows, or an 'nls' object. If it is a two-row data frame, 'nls2' generates a grid or random points within the defined rectangle. If it is a data frame with more than two rows, it runs an optimization for each row. The 'algorithm' parameter determines the method used for generating starting values and performing the optimization. The 'nls2' function can also use the 'CPoptim' algorithm, which requires a two-row data frame with lower and upper bounds for parameters. The function uses the 'nls' function to generate starting values, so 'confint' cannot be used on the resulting objects. Examples demonstrate the use of 'nls2' with different algorithms and starting values, including brute-force search, random search, and linear methods. The package is useful for nonlinear regression and provides more flexibility in choosing starting values and optimization methods.
Reach us at info@study.space
[slides] Nonlinear Regression Analysis and Its Applications | StudySpace