Process the results of the `findMLE` method of a nimble Laplace or AGHQ approximation into a more useful format.
summaryLaplace(
laplace,
MLEoutput,
originalScale = TRUE,
randomEffectsStdError = FALSE,
jointCovariance = FALSE
)summaryAGHQ(
AGHQ,
MLEoutput,
originalScale = TRUE,
randomEffectsStdError = FALSE,
jointCovariance = FALSE
)
A list with data frames `params` and `randomEffects`, each with columns for `estimate` and (possibly) `se` (standard error) and row names for model nodes, a matrix `vcov` with the covariance matrix with row and column names, and `originalScale` with the input value of `originalScale` so it is recorded for later use if wanted.
The Laplace approximation object, typically the compiled one. This would be the result of compiling an object returned from `buildLaplace`.
The maximum likelihood estimate using Laplace or AGHQ,
returned from e.g. `approx$findMLE(...)`, where approx
is the
algorithm object returned by `buildLaplace` or `buildAGHQ`, or (more
typically) the result of compiling that object with `compileNimble`. See
`help(buildLaplace)` for more information.
Should results be returned using the original parameterization in the model code (TRUE) or the potentially transformed parameterization used internally by the Laplace approximation (FALSE). Transformations are used for any parameters and/or random effects that have constrained ranges of valid values, so that in the transformed parameter space there are no constraints.
If TRUE, calculate the standard error of the estimates of random effects values.
If TRUE, calculate the joint covariance matrix of the parameters and random effects together. If FALSE, calculate the covariance matrix of the parameters.
Same as laplace
. Note that `buildLaplace` and
`buildAGHQ` create the same kind of algorithm object that can be used
interchangeably. `buildLaplace` simply sets the number of quadrature points
(`nQuad`) to 1 to achieve Laplace approximation as a special case of AGHQ.
The numbers obtained by this function can be obtained more directly by `approx$summary(...)`. The added benefit of `summaryLaplace` is to arrange the results into data frames (for parameters and random effects), with row names for the model nodes, and also adding row and column names to the covariance matrix.