PredCVBFDens: Compute a Predictive Posterior function given a sequence of...

View source: R/CVBFFunctions.R

PredCVBFDensR Documentation

Compute a Predictive Posterior function given a sequence of bandwidths from the predictive posterior

Description

Compute a Predictive Posterior function given a sequence of bandwidths from the predictive posterior

Usage

PredCVBFDens(bwvec, XT1)

Arguments

bwvec

A vector of bandwidths, can come from either of the methods that draw bandwidths from the posterior.

XT1

The training set

Value

A function that evaluates the predictive posterior at particular values

Examples

set.seed(500)
datasetsample1 = rnorm(600)
trainingindices1 = sample(1:600, size = 300)
XT1 = datasetsample1[trainingindices1]
XV1 = datasetsample1[-trainingindices1]
predbwvec1 = PredCVBFIndepMHbw(ndraw = 500, maxIter = 5000, XT1 = XT1, XV1 = XV1)
predpost = PredCVBFDens(predbwvec1, XT1)
plot(seq(from = -3, to = 3, by = .1), Predpost(predbwvec1, XT1)(seq(from = -3, to = 3, by = .1)))


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