test_fit {OptimModel} | R Documentation |
Test if estimated parameters optimize the regression system (i.e., minimize sums of squares, maximize likelihood).
test_fit(obj, check.pd.tol = 1e-8)
obj |
An |
check.pd.tol |
absolute tolarence for determing whether a matrix is positive definite. |
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.
Returns a TRUE or FALSE as to whether or not hessian component of the object is Positive Definite.
Steven Novick
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)