estimateLoglike: Estimate the synthetic likelihood

Description Usage Arguments Value References See Also Examples

View source: R/estimateLoglike.R

Description

This function computes the estimated synthetic (log) likelihood using one of the four methods (“BSL”, “uBSL”, “semiBSL” and “BSLmisspec”). Please find the links below in the see also section for more details.

Usage

1
2
3
4
5
6
7
8
estimateLoglike(
  ssy,
  ssx,
  method = c("BSL", "uBSL", "semiBSL", "BSLmisspec"),
  log = TRUE,
  verbose = FALSE,
  ...
)

Arguments

ssy

The observed summary statisic.

ssx

A matrix of the simulated summary statistics. The number of rows is the same as the number of simulations per iteration.

method

A string argument indicating the method to be used. The default, “BSL”, runs standard BSL. “uBSL” uses the unbiased estimator of a normal density of \insertCiteGhurye1969;textualBSL. “semiBSL” runs the semi-parametric BSL algorithm and is more robust to non-normal summary statistics. “BSLmisspec” estimates the Gaussian synthetic likelihood whilst acknowledging that there may be incompatibility between the model and the observed summary statistic \insertCiteFrazier2019BSL.

log

A logical argument indicating if the log of likelihood is given as the result. The default is TRUE.

verbose

A logical argument indicating whether an error message should be printed if the function fails to compute a likelihood. The default is FALSE.

...

Arguments to be passed to methods.

  • shrinkage Available for methods “BSL” and “semiBSL”. A string argument indicating which shrinkage method to be used. The default is NULL, which means no shrinkage is used. Shrinkage estimation is only available for methods “BSL” and “semiBSL”. Current options are “glasso” for the graphical lasso method of \insertCiteFriedman2008;textualBSL and “Warton” for the ridge regularisation method of \insertCiteWarton2008;textualBSL.

  • penalty Available for methods “BSL” and “semiBSL”. The penalty value to be used for the specified shrinkage method. Must be between zero and one if the shrinkage method is “Warton”.

  • standardise Available for method “BSL”. A logical argument that determines whether to standardise the summary statistics before applying the graphical lasso. This is only valid if method is “BSL”, shrinkage is “glasso” and penalty is not NULL. The diagonal elements will not be penalised if the shrinkage method is “glasso”. The default is FALSE.

  • GRC Available for method “BSL”. A logical argument indicating whether the Gaussian rank correlation matrix \insertCiteBoudt2012BSL should be used to estimate the covariance matrix in “BSL” method. The default is FALSE, which uses the sample covariance by default.

  • whitening Available for method “BSL”. This argument determines whether Whitening transformation should be used in “BSL” method with Warton's shrinkage. Whitening transformation helps decorrelate the summary statistics, thus encourages sparsity of the synthetic likelihood covariance matrix. This might allow heavier shrinkage to be applied without losing much accuracy, hence allowing the number of simulations to be reduced. By default, NULL represents no Whitening transformation. Otherwise this is enabled if a Whitening matrix is provided. See estimateWhiteningMatrix for the function to estimate the Whitening matrix.

  • ssyTilde Available for method “BSL”. The whitened observed summary statisic. If this is not NULL, it will be used to save computation effort. Only used if Whitening is enabled.

  • kernel Available for method “semiBSL”. A string argument indicating the smoothing kernel to pass into density for estimating the marginal distribution of each summary statistic. Only “gaussian" and “epanechnikov" are available. The default is “gaussian".

  • type Available for method “BSLmisspec”. A string argument indicating which method is used to account for and detect potential incompatibility. The two options are "mean" and "variance".

  • gamma Available for method “BSLmisspec”. The additional latent parameter to account for possible incompatability between the model and observed summary statistic. In “BSLmisspec” method, this is updated with a slice sampler \insertCiteNeal2003BSL.

Value

The estimated synthetic (log) likelihood value.

References

\insertAllCited

See Also

gaussianSynLike, gaussianSynLikeGhuryeOlkin, semiparaKernelEstimate and synLikeMisspec.

Examples

1
2
3
4
5
6
7
8
9
data(ma2)
ssy <- ma2_sum(ma2$data)
m <- newModel(fnSim = ma2_sim, fnSum = ma2_sum, simArgs = ma2$sim_args,
                  theta0 = ma2$start)
ssx <- simulation(m, n = 300, theta = c(0.6, 0.2), seed = 10)$ssx
estimateLoglike(ssy, ssx, method = "BSL")
estimateLoglike(ssy, ssx, method = "uBSL")
estimateLoglike(ssy, ssx, method = "semiBSL")
estimateLoglike(ssy, ssx, method = "BSLmisspec", type = "mean", gamma = rep(0.1, 50))

ziwenan/BSL documentation built on April 25, 2021, 1:11 p.m.