Learn R Programming

OptimModel (version 2.0-1)

test_fit: Test Fit Parameters

Description

Test if estimated parameters optimize the regression system (i.e., minimize sums of squares, maximize likelihood).

Usage

test_fit(obj, check.pd.tol = 1e-8)

Value

Returns a TRUE or FALSE as to whether or not hessian component of the object is Positive Definite.

Arguments

obj

An optim_fit object

check.pd.tol

absolute tolarence for determing whether a matrix is positive definite.

Author

Steven Novick

Details

The function checks if optim convergence has been reached and also checks if the cholesky decompoisition of the Hessian matrix is positive definite. The latter is an indication that optimization has been reached. Sometimes the chol decomposition check doesn't work and to enforce that constriant we use the check.pd.tol to make sure all the eigenvalues are larger than this minimum threshhold.

See Also

optim_fit

Examples

Run this code
set.seed(123L)
x = rep( c(0, 2^(-4:4)), each=4 )
theta = c(0, 100, log(.5), 2)
y1 = hill_model(theta, x) + rnorm( length(x), sd=2 )
wts = runif( length(y1) )
fit1=optim_fit(theta, hill_model, x=x, y=y1)
test_fit(fit1)

Run the code above in your browser using DataLab