CPPevalHR               package:BayHaz               R Documentation

_F_u_n_c_t_i_o_n _t_o _E_v_a_l_u_a_t_e _C_P_P _H_a_z_a_r_d _R_a_t_e_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     CPPevalHR(time, sample)

_A_r_g_u_m_e_n_t_s:

    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')

_V_a_l_u_e:

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

_S_e_e _A_l_s_o:

     'CPPplotHR'

_E_x_a_m_p_l_e_s:

     # 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)

