| nls_test_problem {gslnls} | R Documentation |
Retrieve an NLS test problem
Description
Fetches the model definition and model data required to solve a single NLS test problem with gsl_nls
(or nls if the model is defined as a formula). Use nls_test_list to
list the names of the available NLS test problems.
Usage
nls_test_problem(name, p = NA, n = NA)
Arguments
name |
Name of the NLS test problem, as returned in the |
p |
The number of parameters in the NLS test problem constrained by the |
n |
The number of residuals in the NLS test problem constrained by the |
Value
If the model is defined as a formula, a list of class "nls_test_formula" with elements:
-
dataa data.frame withnrows containing the data (predictor and response values) used in the regression problem. -
fna formula defining the test problem model. -
starta named vector of lengthpwith suggested starting values for the parameters. -
targeta named vector of lengthpwith the certified target values for the parameters corresponding to the best-available solutions.
If the model is defined as a function, a list of class "nls_test_function" with elements:
-
fna function defining the test problem model.fntakes a vector of parameters of lengthpas its first argument and returns a numeric vector of lengthn.fn -
ya numeric vector of lengthncontaining the response values. -
starta numeric named vector of lengthpwith suggested starting values for the parameters. -
jaca function defining the analytic Jacobian matrix of the modelfn.jactakes a vector of parameters of lengthpas its first argument and returns annbypdimensional matrix. -
targeta numeric named vector of lengthpwith the certified target values for the parameters, or a vector ofNA's if no target solution is available.
Note
For several problems the optimal least-squares objective of the target solution can be obtained at multiple different parameter locations.
References
D.M. Bates and Watts, D.G. (1988). Nonlinear Regression Analysis and Its Applications, Wiley, ISBN: 0471816434.
J.J. Moré, Garbow, B.S. and Hillstrom, K.E. (1981). Testing unconstrained optimization software, ACM Transactions on Mathematical Software, 7(1), 17-41.
See Also
https://www.itl.nist.gov/div898/strd/nls/nls_main.shtml
https://people.math.sc.edu/Burkardt/f_src/test_nls/test_nls.html
Examples
## example regression problem
ratkowsky2 <- nls_test_problem(name = "Ratkowsky2")
with(ratkowsky2,
gsl_nls(
fn = fn,
data = data,
start = start
)
)
## example optimization problem
rosenbrock <- nls_test_problem(name = "Rosenbrock")
with(rosenbrock,
gsl_nls(
fn = fn,
y = y,
start = start,
jac = jac
)
)