Fit mortality hazard models, with special attention to humans at old ages.
20160526 - this depends on the version of RcppFaddeeva that is on github and not the CRAN version. (The github version exports the Rcpp headers properly.) So it's necessary to
install_github("baptiste/RcppFaddeeva@5fb5c32")
in order to build this version
(NB: The issue opened by Tim Riffe on github has a solution)
Example steps used to create the Beard hazard object:
create mortalityhazard-beard.R
mortalityHazard
objectcalculate
Using Sage, I produced C++ code to calculate (1) and (2) above.
I put the results in mortalityhazard-beard.cpp
. The function names are:
mortalityhazard_beard_cpp
- calculates the mortality hazard, given paramsmortalityhazard_to_prob_beard_cpp
- given params and ages, calculates cond prob of deathmortalityhazard_beard_binomial_grad_cpp
- calculates the gradient of the binomial likelihoodbeard_partial_alpha_partI
- calculates first part of gradient wrt alphabeard_partial_alpha_partII
- calculates second part of gradient wrt alphaAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.