CPPevalHR: Function to Evaluate CPP Hazard Rates

Description Usage Arguments Value See Also Examples

Description

A function to evaluate a (prior or posterior) sample of CPP hazard rates on a grid of time points.

Usage

1

Arguments

time

vector of time points where the hazard rates in the sample should be evaluated

sample

sample of CPP hazard rates (as generated by CPPpriorSample or CPPpostSample)

Value

A matrix with as many rows as hazard rates in the sample and as many columns as time points in the grid.

See Also

CPPplotHR

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# set RNG seed (for example reproducibility only)
set.seed(1234)

# select a CPP prior distribution
hypars<-CPPpriorElicit(r0 = 0.1, H = 1, T00 = 50, M00 = 2)
# generate a sample of ten hazard rates
prior<-CPPpriorSample(ss = 10, hyp = hypars)

# evaluate the ten hazard rates at year multiples
CPPevalHR(time = seq(0,50), sample = prior)

# load a data set
data(earthquakes)
# generate a posterior sample
post<-CPPpostSample(hypars, times = earthquakes$ti, obs = earthquakes$ob)

# evaluate the posterior hazard rates at year multiples
CPPevalHR(time = seq(0,50), sample = post)

BayHaz documentation built on May 2, 2019, 7:07 a.m.

Related to CPPevalHR in BayHaz...