Learn R Programming

BayHaz (version 0.1-3)

BPSpriorElicit: Function to Set Hyperparameters of BPS Priors

Description

A function to set the hyperparameters of a first order autoregressive BPS prior distribution, approximately assigning constant prior mean hazard rate and corresponding coefficient of variation.

Usage

BPSpriorElicit(r0 = 1, H = 1, T00 = 1, ord = 4, G = 30, c = 0.9)

Arguments

r0
prior mean hazard rate ($r_0$)
H
corresponding coefficient of variation
T00
time-horizon of interest ($T_\infty$)
ord
spline order ($k$)
G
number of internal spline knots
c
correlation coefficient between two consecutive spline weights

Value

  • A list with nine components:
  • r0prior mean hazard rate (copy of the input argument)
  • Hcorresponding coefficient of variation (copy of the input argument)
  • T00time-horizon of interest (copy of the input argument)
  • ordspline order (copy of the input argument)
  • Gnumber of internal spline knots (copy of the input argument)
  • ccorrelation coefficient between two consecutive spline weights (copy of the input argument)
  • knotsfull grid of spline knots
  • mmean of spline coefficients
  • wvariance of spline coefficients

Details

A first order autoregressive BPS prior hazard rate is defined, for $0
  • $\eta_j$is the$j$-th element of a normally distributed vector of spline weights (see below for details)
  • $B_j(t)$is the$j$-th B-spline basis function of order$k$, evaluated at$t$, defined on a grid of$G+2k-2$equispaced knots with first internal knot at$0$and last internal knot at$T_\infty$(seesplineDesignfor details)
  • The spline weights form a stationary AR(1) process with mean $m$, variance $w$ and lag-one autocorrelation $c$. The elicitation procedure takes $w = H^2$ and $m = \log r_0 - 0.5 * w$, based on the mean and variance formulas for the log-normal distribution. As B-spline basis functions form a partition of unity within internal nodes, the mean of $\rho(t)$ is approximately equal to $r0$, for $0

    See Also

    BayHaz-package, BPSpriorSample, BPSpostSample

    Examples

    Run this code
    # ten events per century with unit coefficient of variation and fifty year time horizon
    # cubic splines with minimal number of knots and strongly correlated spline weights
    hypars<-BPSpriorElicit(r0 = 0.1, H = 1, T00 = 50, ord = 4, G = 3, c = 0.9)

    Run the code above in your browser using DataLab