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 "name" column of nls_test_list.

p

The number of parameters in the NLS test problem constrained by the check condition returned by nls_test_list. If NA (default), the default number of parameters as listed by nls_test_list is used.

n

The number of residuals in the NLS test problem constrained by the check condition returned by nls_test_list. If NA (default), the default number of residuals as listed by nls_test_list is used.

Value

If the model is defined as a formula, a list of class "nls_test_formula" with elements:

If the model is defined as a function, a list of class "nls_test_function" with elements:

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

nls_test_list

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
     )
)

[Package gslnls version 1.3.2 Index]