All functions

CALL_D_MEASURE()

Evaluate the log-density of the measurement process by calling measurement process density functions via external Xptr.

CALL_INTEGRATE_STEM_ODE()

Integrate a system of ODEs via external Xptr.

CALL_RATE_FCN()

Update rates by calling rate functions via Xptr.

CALL_R_MEASURE()

Simulate from the measurement process by calling measurement process functions via external Xptr.

CALL_SET_ODE_PARAMS()

Set the parameters for a system of ODEs via XPtr.

add2vec()

Add the contents of one vector to another vector

blocks2cov()

Reconstitute a joint kernel covariance matrix from block covariances

build_census_path()

Construct a matrix containing the compartment counts at a sequence of census times.

build_flowmat()

Given a list of (unparsed) rate functions, construct the matrix of compartment flows.

build_measproc_indmat()

Construct an indicator matrix for which measurement process variables are measured at which observation times.

build_obsmat()

Generate a template for a stemr observation matrix, or combine multiple datasets into a stemr observation matrix; used internally.

build_rate_adjmat()

Construct an adjacency matrix for specifying which rates must be updated when a transition occurs, with adjacency determined at the lumped population level.

build_tcovar_adjmat()

Construct an adjacency matrix for which rates need to be update when there is a change in the time-varying covariates.

build_tcovar_changemat()

Indicator matrix for determining which time-varying covariates change at each row of a time-varying covariate matrix.

build_tcovar_matrix()

Construct a time-varying covariance matrix that includes time and seasonality, based on a user-supplied time-varying covariate matrix. Used internally.

calc_initdist_loglik()

Return the log-lik of initial distribution draws

calc_params_logprior()

Return the log prior density over all parameter blocks

census_incidence()

Construct a matrix containing the incidence counts at a sequence of census times.

census_latent_path()

Construct a matrix containing the compartment counts and the incidence at a sequence of census times.

census_path()

Wrapper for evaluating the compartment counts at census times.

census_path_collection()

Census each path in a collection of paths to obtain the compartment counts at census times.

check_tpar_depends()

Check if time varying parameters depend on initial conditions

comp_chol()

Cholesky decomposition

comp_fcn()

Parses a function of each of a vector of model compartments and aggregates the results.

compute_incidence()

Difference an incidence variable in a census matrix.

convert_lna2()

Convert an LNA path from the counting process on transition events to the compartment densities on their natural scale, making the conversion in place for an existing census matrix.

copy_2_rows()

Copy some of the rows of one matrix into another

copy_col()

Copy the contents of one matrix into another

copy_elem()

Copy an element from one vector into another

copy_elem2()

Copy an multiple elements from one vector into another

copy_mat()

Copy the contents of one matrix into another

copy_pathmat()

Copy the columns of one matrix into another

copy_row()

Copy the contents of one matrix into another

copy_vec()

Copy the contents of one vector into another

copy_vec2()

Copy the contents of one vector into another

dmvtn()

Multivariate normal density

draw_normals()

Draw new N(0,1) values and fill a vector.

draw_normals2()

Draw new N(0,1) values and fill a matrix.

emission()

Generates an emission list to be supplied to the stem_measure function.

evaluate_d_measure()

Evaluate the log-density of the measurement process by calling measurement process density functions via external Xptr.

evaluate_d_measure_LNA()

Evaluate the log-density of a possibly time-verying measurement process by calling measurement process density functions via external Xptr.

expit()

Expit transformation, i.e. inverse logit

find_interval()

Given a vector of interval endpoints breaks, determine in which intervals the elements of a vector x fall.

fit_stem()

Fit a stochastic epidemic model using the linear noise approximation or ordinary differential equations to approximate the latent epidemic process.

forcing()

Declare a time varying covariate to be a forcing variable that moves individuals between model compartments at discrete times. Flow in and out of model compartments is allocated proportionally to the compartment counts in the source and destination compartments.

hello()

Hello, World!

incidence2prevalence()

Convert an LNA/ODE incidence path to a prevalence path.

increment_elem()

Increment an element of a vector by 1

increment_vec()

Add one vector to another

initdist_control()

Generates a list of settings for sampling the latent LNA paths and time-varying parameters via elliptical slice sampling.

initdist_update()

Sample a new LNA path via elliptical slice sampling.

initialize_lna()

Initialize the LNA path

initialize_ode()

Initialize the ODE path

insert_block()

Insert one matrix into another

insert_elem()

insert an element into a vector

insert_initdist()

Insert natural scale parameters into a parameter matrix

insert_params()

Insert natural scale parameters into a parameter matrix

insert_tparam()

Insert time-varying parameters into a tcovar matrix.

integrate_odes()

Obtain the path of the deterministic mean of a stochastic epidemic model by integrating the corresponding ODE functions.

interact()

Interact character vectors to get a character vector of concatenated combinations.

is_progressive()

Determines whether a model is progressive based on its flow matrix

lna_control()

Generates a list of settings for sampling the latent LNA paths and time-varying parameters via elliptical slice sampling.

lna_incid2prev()

Convert an LNA path from the counting process on transition events to the compartment densities on their natural scale.

lna_update()

Sample a new LNA path via elliptical slice sampling.

load_lna()

Construct and compile the functions for proposing an LNA path, with integration of the LNA ODEs accomplished using the Boost odeint library.

load_ode()

Construct and compile the functions for proposing an ODE path, with integration of the deterministic mean ODEs accomplished using the Boost odeint library.

logit()

Logit tranformation

make_stem()

Construct a stem object.

map_draws_2_lna()

Map N(0,1) stochastic perturbations to an LNA path.

map_pars_2_ode()

Map parameters to the deterministic mean incidence increments for a stochastic epidemic model.

mat_2_arr()

Copy a matrix into a slice of an array

mcmc_kernel()

Specify an MCMC transition kernel

mvnmh_control()

Generate a list of settings for Metropolis-Hastings updates and adaptation via the robust adaptive Metropolis algorithm (Vilhola, 2012).

mvnmh_update()

Multivariate normal Metropolis-Hastings update

mvnss_control()

Generate a list of settings for multivariate normal slice sampling

mvnss_settings()

Generate a list of settings for automated factor slice sampling

mvnss_update()

Update model parameters via factor slice sampling

normalise()

normalise a vector in place

normalise2()

return a normalised vector

parblock()

Define a parameter block for an MCMC kernel

pars2lnapars()

Insert parameters into each row of a parameter matrix

pars2lnapars2()

Insert parameters into the first row of a parameter matrix

pars2parmat()

Insert parameters into the first row of a parameter matrix

parse_lna_rates()

Parse the LNA rates so they can be compiled.

parse_meas_procs()

Instatiate the C++ emission probability functions for simulation and density evaluation for a stochastic epidemic model measurement process and return a vector of function pointers.

parse_ode_rates()

Parse the ODE rates so they can be compiled.

parse_parameter_blocks()

Generate a list of objects used in block updating MCMC parameters

parse_rates_exact()

Instatiate the C++ rate functions for a stochastic epidemic model and return a vector of function pointers.

plot_adaptations()

Plot the adaptation schedule for an adaptive MCMC algorithm for a given number of iterations, given as max(1, scale_constant/(1 + iteration * step_size)^scale_cooling)

prepare_initdist_objects()

Prepare initial distribution list for MCMC

prepare_lna_ess_schedule()

Prepare an LNA elliptical slice sampling schedule

prepare_param_blocks()

Prepare the parameter blocks for MCMC

propose_lna()

Simulate an LNA path using a non-centered parameterization for the log-transformed counting process LNA.

propose_lna_approx()

Simulate an approximate LNA path using a non-centered parameterization for the log-transformed counting process LNA. Resample the initial path in place, then update with elliptical slice sampling.

propose_mvnmh()

Multivariate normal Metropolis-Hastings proposal

rate()

Generates a rate list to be supplied to the stem_dynamics funciton.

rate_fcns_4_lna()

Convert unparsed rate functions into rate functions appropriate for applying the LNA to the transition event count processes.

rate_fcns_4_ode()

Convert unparsed rate functions into deterministic mean ODE functions.

rate_update_event()

Identify which rates to update when a state transition event occurs.

rate_update_tcovar()

Identify which rates to update based on changes in the time-varying covariates.

rcpp_hello()

Hello, Rcpp!

reset_nugget()

Reset the nugget based based on a sample

reset_vec()

Reset a vector by filling it with an element

retrieve_census_path()

Insert the compartment counts at a sequence of census times into an existing census matrix.

rmvtn()

Produce samples from a multivariate normal density using the Cholesky decomposition

rsbln()

Stick-Breaking Logit-Normal

sample_unit_sphere()

Sample the unit sphere.

save_ess_rec()

Save the elliptical slice sampling record

save_mcmc_sample()

Save an MCMC sample

sbln_explorer()

Stick-Breaking Logit-Normal Explorer

sbln_normal_to_volume()

Convert Normal Draws to Stick-Breaking Logit-Normal Draws

set_params()

Set the parameter values for a stochastic epidemic model object.

simulate_gillespie()

Simulate a stochastic epidemic model path via Gillespie's direct method and returns a matrix containing a simulated path from a stochastic epidemic model.

simulate_r_measure()

Simulate a data matrix from the measurement process of a stochastic epidemic model.

simulate_stem()

Simulations from a stochastic epidemic model.

stem_dynamics()

Generate the objects governing the dynamics of a stochastic epidemic model.

stem_initializer()

Determines the initial state probabilities or concentrations at the first observation time. This function is applied internally in different ways depending on whether inference (or simulation) is accomplished using the LNA or using Bayesian data augmentation (Gillespie's direct algorithm for simulation).

stem_measure()

Generate a list of objects governing the measurement process for a stochastic epidemic model.

stem_parameters()

Assign a vector of parameters to a stem object

sub_comp_rate()

Makes comp_fcn replacements.

sub_powers()

Parse a string and substitute powers of the form a^b with pow(a,b).

tpar()

Generate a list to be used in specifying a time-varying parameter that has a latent Gaussian distribution and is updated via elliptical slice sampling.

tpar_control()

Generates a list of settings for sampling the latent LNA paths and time-varying parameters via elliptical slice sampling.

tparam_update()

Sample a new LNA path via elliptical slice sampling.

vec_2_arr()

Copy a matrix into a column of a slice of an array

vec_2_mat()

Copy a vector into a matrix

which_absorbing()

Detects which states in a model are absorbing states