summLik: Model density evaluation for given data and parameters

summLikR Documentation

Model density evaluation for given data and parameters

Description

Evaluation of inferred probability density as function of parameters and of (projected) summary statistics is implemented as a generic function summLik. This documentation deals mostly with its method for objects of class SLik_j produced by the up-to-date version of the summary-likelihood workflow.

Given the (projected) statistics for the data used to build the SLik_j object, and the fitted parameters, this returns the (log)likelihood, as the generic logLik extractor does. However, parameters can be varied (so that summLik provides the likelihood function rather than simply its maximum), the data can be varied too, and likelihood profiles (or even full new estimates) are computed when an incomplete parameter vector (or even NULL) is specified.

Usage

summLik(object, parm, data, ...)

## S3 method for class 'SLik_j'
summLik(object, parm, data=t(get_from(object,"proj_data")), 
                         log=TRUE, which="safe", constr_tuning = Inf, 
                         newMSL=FALSE, ...)

Arguments

object

An SLik or SLik_j object

parm

Vector, data frame or matrix, containing coordinates of parameter points for which (log) likelihoods will be computed; or NULL. A profile will be computed if a single incomplete parameter vector is provided. A full new estimate will be computed in parm is NULL.

data

Matrix of (projected, if relevant) summary statistics for which the likelihood of given parameters is to be computed. By default, the (projected) statistics for the data used to build the SLik_j object

log

Boolean: whether to return log likelihood or raw likelihood. Better ignored.

which

character string: "lik" for (log) likelihood deduced from the multivariate gaussian mixture model for joint parameters and summary statistics, without further modifications. But the default, "safe", may correct this result to deal with possible extrapolation artefacts (see Details of predict.SLik_j).

constr_tuning

Passed to predict.SLik_j.

newMSL

Boolean. If this is TRUE and a profile was computed, attributes are added to the result (see Value).

...

further arguments passed to or from other methods. Currently only passed to predict.SLik_j when no likelihood profile is computed.

Value

Numeric vector, with optional attribute(s).

If no profile is computed, it may have attributes from the return value of predict.SLik_j. If a profile is computed, the returned value has attribute "profpt" giving the profile-maximizing parameter vector. Further, if newMSL=TRUE, the following attributes are added: "newobs_MSL", a list with information about unconstrained summary-likelihood maximization (useful mainly when there are new data); and "LRstat", the resulting log-likelihood ratio.

See Also

predict.SLik_j) for case without profiling; logLik, the standard extractor of likelihood for the model fitted to the original data.

Examples

## Not run: 
## Using 'slik_j' object from the example in help("example_reftable") 
summLik(slik_j, parm=slik_j$MSL$MSLE+0.1)

# summLik() generalizes logLik():
summLik(slik_j, parm=slik_j$MSL$MSLE) == logLik(slik_j) # must be TRUE

## End(Not run)

Infusion documentation built on Sept. 30, 2024, 9:16 a.m.

Related to summLik in Infusion...