summLik | R Documentation |

Evaluation of inferred probability density as function of parameters and of (projected) summary statistics is implemented as a generic function `summLik`

.
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. However, parameters can be varied (providing the likelihood function), and the data too.

This documentation deals mostly with the method for objects of class `SLik_j`

produced by the up-to-date version of the summary-likelihood workflow.

summLik(object, parm, data, ...) # S3 method for class 'SLik_j' ## S3 method for class 'SLik_j' summLik(object, parm, data=t(attr(object$logLs,"stat.obs")), log=TRUE, which="lik", ...)

`object` |
An |

`parm` |
data frame or matrix, containing coordinates of parameter points for which (log) likelihoods will be computed |

`data` |
The (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 |

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

`which` |
character string: |

`...` |
further arguments passed to or from other methods. |

An object of class `SLik_j`

contains a simulated joint distribution of parameters and (projected) summary statistics, and a fit of a multivariate gaussian mixture model to this simulated distribution, the “jointdens”, from which a marginal density “margpardens” of parameters can be deduced. The raw likelihood(P;D) is the probability of the data D given the parameters P, viewed as function the parameters and for fixed data. It is inferred as jointdens(D,P)/margpardens(P) (for different P, each of jointdens and margdens are probabilities from a single (multivariate) gaussian mixture model, but this is not so for their ratio).

When margdens(P) is low, indicating that the region of parameter space around P has been poorly sampled in the simulation step, inference of likelihood is unreliable. Spuriously high likelihood may be inferred, which results notably in poor inference based on likelihood ratios. For this reason, it is often better to use the argument `which="safe"`

whereby the likelihood is penalized when margdens(P) is low. The penalization is of the form

`penalized= unpenalized * pmin(1,margpardens/object$thr_dpar)`

, where `thr_dpar`

is a marginal density threshold stored in the `SLik_j`

object. The source code should be consulted for details, and is subject to changes without notice.

Numeric vector

`logLik`

.

## 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)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.