select_proposals {geoBayes} | R Documentation |
Selection of multiple importance sampling distributions
Description
Selection of multiple importance sampling distributions
Usage
select_proposals_SEQ(
pargrid,
K,
istart,
relativeSE = FALSE,
N1,
N2,
Nthin,
Nbi,
formula,
family = "gaussian",
data,
weights,
subset,
offset,
atsample,
corrfcn = "matern",
betm0,
betQ0,
ssqdf,
ssqsc,
dispersion = 1,
longlat = FALSE,
nbatch1 = 0.5,
nbatch2 = 0.5,
S1method = c("RL", "MW"),
bvmethod = c("Standard", "TukeyHanning", "Bartlett"),
transf = c("no", "mu", "wo")
)
select_proposals_MNX(
pargrid,
istart,
nfix,
relativeSE = FALSE,
N1,
N2,
Nthin,
Nbi,
cooling,
formula,
family = "gaussian",
data,
weights,
subset,
offset,
atsample,
corrfcn = "matern",
betm0,
betQ0,
ssqdf,
ssqsc,
dispersion = 1,
longlat = FALSE,
nbatch1 = 0.5,
nbatch2 = 0.5,
S1method = c("RL", "MW"),
bvmethod = c("Standard", "TukeyHanning", "Bartlett"),
transf = c("no", "mu", "wo"),
verbose = FALSE
)
select_proposals_ENT(
pargrid,
istart,
nfix,
relativeSE = FALSE,
N1,
Nthin,
Nbi,
cooling,
formula,
family = "gaussian",
data,
weights,
subset,
offset,
atsample,
corrfcn = "matern",
betm0,
betQ0,
ssqdf,
ssqsc,
dispersion = 1,
longlat = FALSE,
nbatch1 = 0.5,
nbatch2 = 0.5,
S1method = c("RL", "MW"),
bvmethod = c("Standard", "TukeyHanning", "Bartlett"),
transf = c("no", "mu", "wo"),
verbose = FALSE
)
Arguments
pargrid |
A data frame with components "linkp", "phi", "omg", "kappa". Each row gives a combination of the parameters to compute the new standard errors. |
K |
How many proposal densities in total to choose among the
rows of |
istart |
Start with these rows of |
relativeSE |
Logical. Whether the choice is based on the standard error (FALSE), or relative standard error (TRUE). |
N1 |
The sample size for stage 1. |
N2 |
The sample sie for stage 2. |
Nthin |
Thinning |
Nbi |
Burn-in |
formula |
A representation of the model in the form
|
family |
The distribution of the data. The
|
data |
An optional data frame containing the variables in the model. |
weights |
An optional vector of weights. Number of replicated samples for Gaussian and gamma, number of trials for binomial, time length for Poisson. |
subset |
An optional vector specifying a subset of observations to be used in the fitting process. |
offset |
See |
atsample |
A formula in the form |
corrfcn |
Spatial correlation function. See
|
betm0 |
Prior mean for beta (a vector or scalar). |
betQ0 |
Prior standardised precision (inverse variance) matrix. Can be a scalar, vector or matrix. The first two imply a diagonal with those elements. Set this to 0 to indicate a flat improper prior. |
ssqdf |
Degrees of freedom for the scaled inverse chi-square prior for the partial sill parameter. |
ssqsc |
Scale for the scaled inverse chi-square prior for the partial sill parameter. |
dispersion |
The fixed dispersion parameter. |
longlat |
How to compute the distance between locations. If
|
nbatch1 |
A scalar or vector of the same length as
|
nbatch2 |
A scalar or vector of the same length as
|
S1method |
Which method to use to calculate the Bayes factors: Reverse logistic or Meng-Wong. |
bvmethod |
Which method to use for the calculation of the batch variance. The standard method splits to disjoint batches. The second and third method use the spectral variance method with different lag windows. |
transf |
Whether to use a transformed sample for the
computations. If |
nfix |
In the case of MNX and ENT, the first |
cooling |
A decreasing sequence of temperature values for the
simulated annealing. All elements must be positive. A suggested
value is |
verbose |
Logical. Prints information about the simulated annealing. |
Details
- SEQ
is a sequential method starting with
istart
and additng to it untilK
proposals have been selected. At each iteration, the point with the highest (relative?) standard error is added- MNX
is the minimax method. The chosen proposal corresponds to the lowest maximum (relative?) standard error.
- ENT
is the entropy method. The chosen proposal corresponds to the highest determinant of the (relative?) covariance matrix at the first stage.
Value
A list with components
- selected
The rows of
pargrid
selected.- isel
The indices of the rows of
pargrid
selected.- se
The standard error corresponding to the selected parameters.
- samples
A list containing the samples from the selected parameters.
References
Roy, V., & Evangelou, E. (2018). Selection of proposal distributions for generalized importance sampling estimators. arXiv preprint arXiv:1805.00829.
Examples
## Not run:
data(rhizoctonia)
### Define the model
corrf <- "spherical"
kappa <- 0
ssqdf <- 1
ssqsc <- 1
betm0 <- 0
betQ0 <- .01
family <- "binomial.probit"
formula <- Infected ~ 1
atsample <- ~ Xcoord + Ycoord
### Skeleton points
philist <- seq(100, 200, 10)
omglist <- 0
parlist <- expand.grid(linkp=0, phi=philist, omg=omglist, kappa = kappa)
### MCMC sizes
Nout <- 100
Nthin <- 1
Nbi <- 10
## Select proposals
K <- 3 # Choose 3 proposals
istart_SEQ <- 6 # Start with middle
istart_MNX <- istart_ENT <- c(6, 2, 10)
cooling_MNX <- .05/log((0:24 %/% 5)*5 + exp(1))
cooling_ENT <- .3/log((0:49 %/% 10)*10 + exp(1))
prop_SEQ <- select_proposals_SEQ(pargrid = parlist, K = K,
istart = istart_SEQ,
relativeSE = TRUE,
N1 = Nout, N2 = Nout,
Nthin = Nthin, Nbi = Nbi,
formula = formula, family = family,
data = rhizoctonia, weights = Total,
atsample = atsample, corrfcn = corrf,
betm0 = betm0, betQ0 = betQ0,
ssqdf = ssqdf, ssqsc = ssqsc,
dispersion = 1, longlat = FALSE,
nbatch1 = 0.5, nbatch2 = 0.5,
bvmethod = "TukeyHanning",
transf = "mu")
prop_MNX <- select_proposals_MNX(pargrid = parlist,
istart = istart_MNX, nfix = 1L,
cooling = cooling_MNX,
relativeSE = TRUE,
N1 = Nout, N2 = Nout,
Nthin = Nthin, Nbi = Nbi,
formula = formula, family = family,
data = rhizoctonia, weights = Total,
atsample = atsample, corrfcn = corrf,
betm0 = betm0, betQ0 = betQ0,
ssqdf = ssqdf, ssqsc = ssqsc,
dispersion = 1, longlat = FALSE,
nbatch1 = 0.5, nbatch2 = 0.5,
bvmethod = "TukeyHanning",
transf = "mu",
verbose = TRUE)
prop_ENT <- select_proposals_ENT(pargrid = parlist,
istart = istart_ENT, nfix = 1L,
cooling = cooling_ENT,
relativeSE = TRUE,
N1 = Nout,
Nthin = Nthin, Nbi = Nbi,
formula = formula, family = family,
data = rhizoctonia, weights = Total,
atsample = atsample, corrfcn = corrf,
betm0 = betm0, betQ0 = betQ0,
ssqdf = ssqdf, ssqsc = ssqsc,
dispersion = 1, longlat = FALSE,
nbatch1 = 0.5, nbatch2 = 0.5,
bvmethod = "TukeyHanning",
transf = "mu",
verbose = TRUE)
## End(Not run)