SECF {ZVCV} | R Documentation |
Semi-exact control functionals (SECF)
Description
This function performs semi-exact control functionals as described in South et al (2020).
To choose between different kernels using cross-validation, use SECF_crossval
.
Usage
SECF(
integrands,
samples,
derivatives,
polyorder = NULL,
steinOrder = NULL,
kernel_function = NULL,
sigma = NULL,
K0 = NULL,
est_inds = NULL,
apriori = NULL,
diagnostics = FALSE
)
Arguments
integrands |
An |
samples |
An |
derivatives |
An |
polyorder |
(optional) The order of the polynomial to be used in the parametric component, with a default of |
steinOrder |
(optional) This is the order of the Stein operator. The default is |
kernel_function |
(optional) Choose between "gaussian", "matern", "RQ", "product" or "prodsim". See below for further details. |
sigma |
(optional) The tuning parameters of the specified kernel. This involves a single length-scale parameter in "gaussian" and "RQ", a length-scale and a smoothness parameter in "matern" and two parameters in "product" and "prodsim". See below for further details. |
K0 |
(optional) The kernel matrix. One can specify either this or all of |
est_inds |
(optional) A vector of indices for the estimation-only samples. The default when |
apriori |
(optional) A vector containing the subset of parameter indices to use in the polynomial. Typically this argument would only be used if the dimension of the problem is very large or if prior information about parameter dependencies is known. The default is to use all parameters |
diagnostics |
(optional) A flag for whether to return the necessary outputs for plotting or estimating using the fitted model. The default is |
Value
A list with the following elements:
-
expectation
: The estimate(s) of the () expectation(s).
-
f_true
: (Only ifest_inds
is notNULL
) The integrands for the evaluation set. This should be the same as integrands[setdiff(1:N,est_inds),]. -
f_hat
: (Only ifest_inds
is notNULL
) The fitted values for the integrands in the evaluation set. This can be used to help assess the performance of the Gaussian process model. -
a
: (Only ifdiagnostics
=TRUE
) The value ofas described in South et al (2020), where predictions are of the form
for heldout K0 and Phi matrices and estimators using heldout samples are of the form
.
-
b
: (Only ifdiagnostics
=TRUE
) The value ofas described in South et al (2020), where predictions are of the form
for heldout K0 and Phi matrices and estimators using heldout samples are of the form
.
-
ksd
: (Only ifdiagnostics
=TRUE
) An estimated kernel Stein discrepancy based on the fitted model that can be used for diagnostic purposes. See South et al (2020) for further details. -
bound_const
: (Only ifdiagnostics
=TRUE
andest_inds
=NULL
) This is such that the absolute error for the estimator should be less than.
Warning
Solving the linear system in SECF has complexity where
is the sample size and
is the number of terms in the polynomial.
Standard SECF is therefore not suited to large
. The method aSECF is designed for larger
and details can be found at
aSECF
and in South et al (2020).
An alternative would be to use which has
complexity in solving the linear system and
complexity in
handling the remaining samples, where
is the length of
. This can be much cheaper for small
but the estimation of the
Gaussian process model is only done using
samples and the evaluation of the integral only uses
samples.
On the choice of
, the kernel and the Stein order
The kernel in Stein-based kernel methods is where
is a first or second order Stein operator in
and
is some generic kernel to be specified.
The Stein operators for distribution are defined as:
-
steinOrder=1
:(see e.g. Oates el al (2017))
-
steinOrder=2
:(see e.g. South el al (2020))
Here is the first order derivative wrt
and
is the Laplacian operator.
The generic kernels which are implemented in this package are listed below. Note that the input parameter sigma
defines the kernel parameters .
-
"gaussian"
: A Gaussian kernel, -
"matern"
: A Matern kernel with,
where
,
and
is the modified Bessel function of the second kind. Note that
is the length-scale parameter and
is the smoothness parameter (which defaults to 2.5 for
and 4.5 for
).
-
"RQ"
: A rational quadratic kernel, -
"product"
: The product kernel that appears in Oates et al (2017) with -
"prodsim"
: A slightly different product kernel with(see e.g. https://www.imperial.ac.uk/inference-group/projects/monte-carlo-methods/control-functionals/),
In the above equations, and
. For the last two kernels, the code only has implementations for
steinOrder
=1
. Each combination of steinOrder
and kernel_function
above is currently hard-coded but it may be possible to extend this to other kernels in future versions using autodiff. The calculations for the first three kernels above are detailed in South et al (2020).
Author(s)
Leah F. South
References
Oates, C. J., Girolami, M. & Chopin, N. (2017). Control functionals for Monte Carlo integration. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(3), 695-718.
South, L. F., Karvonen, T., Nemeth, C., Girolami, M. and Oates, C. J. (2020). Semi-Exact Control Functionals From Sard's Method. https://arxiv.org/abs/2002.00033
See Also
See ZVCV for examples and related functions. See SECF_crossval
for a function to choose between different kernels for this estimator.