selectPenalty {BSL}  R Documentation 
Selecting the Penalty Parameter
Description
This is the main function for selecting the shrinkage (graphical
lasso or Warton's estimator) penalty parameter for method BSL or semiBSL
based on a point estimate of the parameters. Parallel computing is
supported with the R package foreach
. The penalty selection method
is outlined in An et al. (2019).
Usage
selectPenalty(
ssy,
n,
lambda,
M,
sigma = 1.5,
model,
theta = NULL,
method = c("BSL", "semiBSL"),
shrinkage = c("glasso", "Warton"),
parallelSim = FALSE,
parallelSimArgs = NULL,
parallelMain = FALSE,
verbose = 1L,
...
)
Arguments
ssy 
A summary statistic vector for the observed data. 
n 
A vector of possible values of 
lambda 
A list, with each entry containing the vector of
penalty values to test for the corresponding choice of 
M 
The number of repeats to use in estimating the standard deviation of the estimated log synthetic likelihood. 
sigma 
The standard deviation of the log synthetic likelihood estimator to aim for, usually a value between 1 and 2. This parameter helps to control the mixing of a Markov chain. 
model 
A “MODEL” object generated with function

theta 
A point estimate of the parameter value which
all of the simulations will be based on. By default, if 
method 
A string argument indicating the method to be used. If the method is “BSL”, the shrinkage is applied to the Gaussian covariance matrix. Otherwise if the method is “semiBSL”, the shrinkage is applied to the correlation matrix of the Gaussian copula. 
shrinkage 
A string argument indicating which shrinkage method to be used. Current options are “glasso” for the graphical lasso method of Friedman et al. (2008) and “Warton” for the ridge regularisation method of Warton (2008). 
parallelSim 
A logical value indicating whether parallel
computing should be used for simulation and summary statistic evaluation.
Default is 
parallelSimArgs 
A list of additional arguments to pass into the

parallelMain 
A logical value indicating whether parallel
computing should be used to computing the graphical lasso function. Notice
that this should only be turned on when there are a lot of candidate values
in 
verbose 
An integer indicating the verbose style. 0L
means no verbose messages will be printed. 1L uses a custom progress bar to
track the progress. 2L prints the iteration numbers ( 
... 
Other arguments to pass to 
Value
An S4 object PENALTY
of the penalty selection results. The
show
and plot
methods are provided with the S4 class.
Author(s)
Ziwen An, Leah F. South and Christopher Drovandi
References
An Z, South LF, Nott DJ, Drovandi CC (2019).
“Accelerating Bayesian Synthetic Likelihood With the Graphical Lasso.”
Journal of Computational and Graphical Statistics, 28(2), 471–475.
doi: 10.1080/10618600.2018.1537928.
Friedman J, Hastie T, Tibshirani R (2008).
“Sparse Inverse Covariance Estimation with the Graphical Lasso.”
Biostatistics, 9(3), 432–441.
Warton DI (2008).
“Penalized Normal Likelihood and Ridge Regularization of Correlation and Covariance Matrices.”
Journal of the American Statistical Association, 103(481), 340–349.
doi: 10.1198/016214508000000021.
See Also
PENALTY
for the usage of the S4 class. ma2
,
cell
and mgnk
for examples. bsl
for the main function to run BSL.
Examples
## Not run:
data(ma2)
model < newModel(fnSimVec = ma2_sim_vec, fnSum = ma2_sum, simArgs = ma2$sim_args,
theta0 = ma2$start, fnLogPrior = ma2_prior)
theta < c(0.6,0.2)
# Performing tuning for BSLasso (BSL with glasso shrinkage estimation)
ssy < ma2_sum(ma2$data)
lambda_all < list(exp(seq(3,0.5,length.out=20)), exp(seq(4,0.5,length.out=20)),
exp(seq(5.5,1.5,length.out=20)), exp(seq(7,2,length.out=20)))
set.seed(100)
sp_ma2 < selectPenalty(ssy = ssy, n = c(50, 150, 300, 500), lambda_all, theta = theta,
M = 100, sigma = 1.5, model = model, method = 'BSL', shrinkage = 'glasso')
sp_ma2
plot(sp_ma2)
## End(Not run)