PredCVBFMHbw: Draw bandwidths from CVBF predictive posterior by Metropolis...

View source: R/CVBFFunctions.R

PredCVBFMHbwR Documentation

Draw bandwidths from CVBF predictive posterior by Metropolis Hasting sampling

Description

Draw bandwidths from CVBF predictive posterior by Metropolis Hasting sampling

Usage

PredCVBFMHbw(
  ndraw = 100,
  propsd = NULL,
  maxIter = 10000,
  XT1,
  XV1,
  startingbw = NULL
)

Arguments

ndraw

Number of unique draws desired for the bandwidth parameter from the posterior.

propsd

A tuning parameter, corresponds to what proposal standard deviation should be for when using MH to traverse the posterior. Should be chosen with care to ensure good mixing.

maxIter

The max number of MH iterations to try. Do not set to be too large. It will kick the code out if acceptance rates for MH are small.

XT1

Training set for a data set

XV1

Validation set for a data set

startingbw

A value to start the MH chain at. If not provided, starts at posterior mode.

Value

A list of bandwidths that come from the posterior distribution. This will be larger than ndraw, as some draws will be repeats.

Examples

set.seed(500)
datasetsample1 = rnorm(600)
trainingindices1 = sample(1:600, size = 300)
XT1 = datasetsample1[trainingindices1]
XV1 = datasetsample1[-trainingindices1]
predbwvec1 = PredCVBFMHbw(ndraw = 500, maxIter = 5000, XT1 = XT1, XV1 = XV1)

naveedmerchant/BayesScreening documentation built on June 13, 2024, 7:56 a.m.