| BSL-class {BSL} | R Documentation |
S4 class “BSL”.
Description
The S4 class “BSL” is produced by running function
bsl and contains the result of a BSL run. Basic S4 methods
show, summary and plot are provided. theta and
loglike returns the MCMC samples of parameter values and estimated
log-likelihoods.
Usage
## S4 method for signature 'BSL'
show(object)
## S4 method for signature 'BSL'
summary(object, burnin = 0, thetaNames = NULL)
## S4 method for signature 'BSL,ANY'
plot(
x,
which = 1L,
thin = 1,
burnin = 0,
thetaTrue = NULL,
options.plot = NULL,
top = "Approximate Univariate Posteriors",
options.density = list(),
options.theme = list()
)
## S4 method for signature 'BSL'
getTheta(object, burnin = 0, thin = 1)
## S4 method for signature 'BSL'
getLoglike(object, burnin = 0, thin = 1)
## S4 method for signature 'BSL'
getGamma(object, burnin = 0, thin = 1)
Arguments
object |
A “BSL” class object. |
burnin |
the number of MCMC burn-in steps to be taken. |
thetaNames |
Parameter names to be shown in the summary table. If not given, parameter names of the “BSL” object will be used by default. |
x |
A “BSL” class object to plot. |
which |
An integer argument indicating which plot function to be
used. The default, |
thin |
A numeric argument indicating the gap between samples to
be taken when thinning the MCMC draws. The default is |
thetaTrue |
A set of true parameter values to be included on the plots
as a reference line. The default is |
options.plot |
A list of additional arguments to pass into the
|
top |
A character argument of the combined plot title if
|
options.density |
A list of additional arguments to pass into the
|
options.theme |
A list of additional arguments to pass into the
|
Slots
thetaObject of class “matrix”. MCMC samples from the joint approximate posterior distribution of the parameters.
loglikeObject of class “numeric”. Accepted MCMC samples of the estimated log-likelihood values.
callObject of class “call”. The original code that was used to call the method.
modelObject of class “MODEL”.
acceptanceRateObject of class “numeric”. The acceptance rate of the MCMC algorithm.
earlyRejectionRateObject of class “numeric”. The early rejection rate of the algorithm (early rejection may occur when using bounded prior distributions).
errorRateObject of class “numeric”. The error rate. If any infinite summary statistic or infinite log-likelihood estimate occurs during the process, it is marked as an error and the proposed parameter will be rejected.
yObject of class “ANY”. The observed data.
nObject of class “numeric”. The number of simulations from the model per MCMC iteration to estimate the synthetic likelihood.
MObject of class “numeric”. The number of MCMC iterations.
covRandWalkObject of class “matrix”. The covariance matrix used in multivariate normal random walk proposals.
methodObject of class “character”. The character argument indicating the used method.
shrinkageObject of class “characterOrNULL”. The character argument indicating the shrinkage method.
penaltyObject of class “numericOrNULL”. The penalty value.
GRCObject of class “logical”. Whether the Gaussian rank correlation matrix is used.
logitTransformObject of class “logical”. The logical argument indicating whether a logit transformation is used in the algorithm.
logitTransformBoundObject of class “matrixOrNULL”. The matrix of logitTransformBound.
standardiseObject of class “logical”. The logical argument that determines whether to standardise the summary statistics.
parallelObject of class “logical”. The logical value indicating whether parallel computing is used in the process.
parallelArgsObject of class “listOrNULL”. The list of additional arguments to pass into the
foreachfunction.timeObject of class “difftime”. The running time.
gammaObject of class “numeric”. MCMC samples of gamma parameter values of the mean adjustment or variance inflation for method “BSLmisspec”.
misspecTypeObject of class “characterOrNULL”. The character argument indicating whether mean adjustment ("mean") or variance inflation ("variance") to be used in "BSLmisspec" method.
tauObject of class “numeric”. Parameter of the prior distribution for "BSLmisspec" method. For mean adjustment,
tauis the scale of the Laplace distribution. For variance inflation,tauis the mean of the exponential distribution.whiteningObject of class “logicalOrMatrixOrNULL”. A logical argument determines whether Whitening transformation is used in “BSL” method with Warton's shrinkage, or just the Whitening matrix used.
Examples
## Not run:
# a toy example
toy_simVec <- function(n, theta) matrix(rnorm(n, theta), nrow = n) # the simulation function
toy_sum <- function(x) x # the summary statistic function
model <- newModel(fnSimVec = toy_simVec, fnSum = toy_sum, theta0 = 0) # create the model object
result_toy <- bsl(y = 1, n = 100, M = 1e4, model = model, covRandWalk = matrix(1))
summary(result_toy)
plot(result_toy)
## End(Not run)