mra
fitting. Typically only used when calling one of the
*.estim
routines.
mra.control(algorithm=1, maxfn=1000, cov.meth=1, trace=0, tol=1e-07 )
algorithm
= 1,
the VA09AD algorithm from the HSL library is used. The VA09AD algorithm is very reliable,
has been tested extensively (same algorithm as Program MARK), and will almost always find the
maximum likelihood estimates. This parameter was added to allow easy addition of other
algorithms in the future, but no other options are currently implemented because VA09AD
works so well. Anything other than 1 throws a warning and resets the value
to 1. maxfn
times within the minimization routine (but not the hessian or gradient routine).
Decreasing this value will cause the fitting routine to give up on badly-behaved
models quicker and return faster. In some simulation where ill-conditioned data
can be generated, decreasing this parameter can speed up the
simulation tremendously.
Increasing this value may allow marginally-behaved (slow to converge) models to converge.
cov.meth
= 1
takes numerical 2nd partial derivatives. cov.meth
= 2 inverts the Hessian
of the maximization. Method 1 (numeric 2nd derivatives) is the preferred method, but
is computationally expensive and therefore slower than method 2. The difference in
speed is minimal when number of parameters < 15. Method 2 variances are
generally very close to method 1 variances, and could be used during initial model
fitting stages when exact estimation of variance may not be necessary. trace
!= 0,
a few lines will be written to the R console and a log file (named mra.log
) will be
opened in the current directory and details of the fitting process will
be written there. The level of detail written to the log depends on the value of trace.
If trace
== 1, details written to the log include TEST2 and TEST3 results used to determine
c-hat, details from the fitting algorithm, the variance covarince matrix,
singular values of the VC matrix used to determine df
, and other
statistics. If trace
== 2, all trace == 1 details plus the likelihood output is written
to the log. If trace
== 3, all trace == 2 details plus the gradient is written
to the log.
When using algorithm
= 1 (VA09AD), trace
has additional meaning. If trace
> 3,
the coefficient and gradient vectors are written every |trace| iterations and also on exit.
Output is of the form: Function value, beta(1), beta(2), ..., beta(n), G(1), ...G(n).
Coefficient and gradient values are suppressed if trace
< 0 (only final results printed).
Intermediate values from within VA09AD are suppressed if trace
> maxit
+ 1, but
other intermediate values are output.
trace
> 1 probably produces more output than the casual (non-geek statistician) wants
to look at. But, geek statisticans may find trace
> 3 useful for assessing stability and
determining when the routine gets stuck in a local minima.
F.cjs.estim
, F.huggins.estim
data(dipper.histories)
ct <- as.factor( paste("T",1:ncol(dipper.histories), sep=""))
attr(ct,"nan")<-nrow(dipper.histories)
dipper.cjs <- F.cjs.estim( ~tvar(ct,drop=c(1,2)), ~tvar(ct,drop=c(1,6,7)),
dipper.histories, control=mra.control(trace=1, maxfn=200) )
Run the code above in your browser using DataLab