MGH17                package:NISTnls                R Documentation

_M_o_r_e, _G_a_b_r_o_w _a_n_d _H_i_l_l_s_t_r_o_m _e_x_a_m_p_l_e _1_7

_D_e_s_c_r_i_p_t_i_o_n:

     The 'MGH17' data frame has 33 rows and 2 columns

_F_o_r_m_a_t:

     This data frame contains the following columns:

     _y A numeric vector of response values.

     _x A numeric vector of input values.


_D_e_t_a_i_l_s:

     This problem was found to be difficult for some very good
     algorithms.

     See More, J. J., Garbow, B. S., and Hillstrom, K. E. (1981). 
     _Testing unconstrained optimization software._ *ACM Transactions
     on Mathematical Software.* 7(1): pp. 17-41.

_S_o_u_r_c_e:

     Osborne, M. R. (1972).   Some aspects of nonlinear least squares 
     calculations.  In Numerical Methods for Nonlinear  Optimization,
     Lootsma (Ed).   New York, NY:  Academic Press, pp. 171-189.

_E_x_a_m_p_l_e_s:

     Try <- function(expr) if (!inherits(val <- try(expr), "try-error")) val
     plot(y ~ x, data = MGH17)

     ## Starting values here are ridiculous
     Try(fm1 <- nls(y ~ b1 + b2*exp(-x*b4) + b3*exp(-x*b5),
                data = MGH17, trace = TRUE,
                start = c(b1 = 50, b2 = 150, b3 = -100, b4 = 1, b5 = 2)))
     Try(fm1a <- nls(y ~ b1 + b2*exp(-x*b4) + b3*exp(-x*b5),
                data = MGH17, trace = TRUE, alg = "port",
                start = c(b1 = 50, b2 = 150, b3 = -100, b4 = 1, b5 = 2)))

     Try(fm2 <- nls(y ~ b1 + b2*exp(-x*b4) + b3*exp(-x*b5),
                data = MGH17, trace = TRUE,
                start = c(b1 = 0.5, b2 = 1.5, b3 = -1, b4 = 0.01, b5 = 0.02)))
     Try(fm2a <- nls(y ~ b1 + b2*exp(-x*b4) + b3*exp(-x*b5),
                data = MGH17, trace = TRUE, alg = "port",
                start = c(b1 = 0.5, b2 = 1.5, b3 = -1, b4 = 0.01, b5 = 0.02)))

     Try(fm3 <- nls(y ~ cbind(1, exp(-x*b4), exp(-x*b5)),
                data = MGH17, trace = TRUE, algorithm = "plinear",
                start = c(b4 = 1, b5 = 2)))

     Try(fm4 <- nls(y ~ cbind(1, exp(-x*b4), exp(-x*b5)),
                data = MGH17, trace = TRUE, algorithm = "plinear",
                start = c(b4 = 0.01, b5 = 0.02)))

