a b/man/get_cpp_api.Rd
1
% Generated by roxygen2: do not edit by hand
2
% Please edit documentation in R/get_cpp_api.R
3
\name{get_cpp_api}
4
\alias{get_cpp_api}
5
\title{Access internal C++ rountines used in outbreaker2}
6
\usage{
7
get_cpp_api()
8
}
9
\value{
10
An environment containing Rcpp bindings to C++ functions used internally in
11
outbreaker2. All functions are named as cpp_[type]_[component], where 'type'
12
can be:
13
14
\itemize{
15
16
\item 'prior': prior computation
17
18
\item 'll':  likelihood computation
19
20
\item 'move': movement of parameters or augmented data
21
22
}
23
24
And where 'component' can be:
25
26
\itemize{
27
28
\item 'mu': (parameter) mutation rate
29
30
\item 'pi': (parameter) reporting probability
31
32
\item 'lambda': (parameter) non-infectious contact rate
33
34
\item 'eps': (parameter) contact reporting coverage
35
36
\item 'alpha': (augmented data) ancestries of the cases
37
38
\item 'kappa': (augmented data) generation between cases on transmission
39
chains
40
41
\item 't_inf': (augmented data) dates of infections
42
43
\item 'timing_infections': (likelihood component) timing between infectors and
44
infectees
45
46
\item 'timing_sampling': (likelihood component) timing between infection and
47
reporting / isolation
48
49
\item 'timing': (likelihood component) sum of the two timing components
50
51
\item 'genetic': (likelihood component) genetic diversity accumulated along
52
transmission chains
53
54
\item 'reporting': (likelihood component) reporting of cases
55
56
\item 'all': (likelihood component) sum of all likelihood components
57
58
\item 'swap_cases': (type of movement) swap infectors and infectees on a
59
transmission tree 
60
61
}
62
63
For a description of the arguments of these functions, see the Rcpp_API
64
vignette (\code{vignette("Rcpp_API", package = "outbreaker2")}).
65
}
66
\description{
67
This function returns an environment containing all C++ functions (bound to R
68
using Rcpp) used for priors, likelihoods, and movements of parameters in
69
outbreaker2.
70
}
71
\examples{
72
73
## get functions in an environment
74
api <- get_cpp_api()
75
api
76
77
## check content of the environment
78
ls(api)
79
80
## test the prior for mu
81
args(api$cpp_prior_mu)
82
83
config <- create_config()
84
85
api$cpp_prior_mu(list(mu = 0.00123), config)
86
87
dexp(0.00123, rate = config$prior_mu, log = TRUE)
88
89
}
90
\author{
91
Thibaut Jombart (\email{thibautjombart@gmail.com})
92
}