predictive_pdf: Predictive PDF

Description Usage Arguments Value Examples

Description

predictive_pdf() evaluates the predictive PDF of the model specified by a DataDistribution dist and Prior at the given stage-one outcome.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
predictive_pdf(dist, prior, x1, n1, ...)

## S4 method for signature 'DataDistribution,PointMassPrior,numeric'
predictive_pdf(dist, prior, x1, n1, ...)

## S4 method for signature 'DataDistribution,ContinuousPrior,numeric'
predictive_pdf(
  dist,
  prior,
  x1,
  n1,
  k = 10 * (prior@support[2] - prior@support[1]) + 1,
  ...
)

Arguments

dist

a univariate distribution object

prior

a Prior object

x1

stage-one test statistic

n1

stage-one sample size

...

further optional arguments

k

number of pivots for crude integral approximation

Value

numeric, value of the predictive PDF

Examples

1
2
3
4
predictive_pdf(Normal(), PointMassPrior(.3, 1), 1.5, 20) # ~.343

tmp <- ContinuousPrior(function(x) dunif(x, .2, .4), c(.2, .4))
predictive_pdf(Normal(), tmp, 2, 20)

adoptr documentation built on June 28, 2021, 5:11 p.m.