R/RcppExports.R

Defines functions toUnitScale model_NEW posterior_NEW individual_sim_NEW posterior_4 posterior_3 posterior_2 posterior_1 obs_error multiple_sim individual_sim vector_order vector_sort likelihood_titre

Documented in likelihood_titre toUnitScale

# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#' Calculate likelihood
#'
#' Calculates the likelihood of a given set of observed titres given predicted titres. Based on truncated discritised normal.
#' @param expected NumericVector, as returned by \code{\link{infection_model_indiv}}
#' @param data NumericVector, the vector of observed titres
#' @param theta NumericVector, the vector of named model parameters, requiring MAX_TITRE and error
#' @return a single log likelihood
#' @export
likelihood_titre <- function(expected, data, error, MAX_TITRE) {
    .Call('_serosim2_likelihood_titre', PACKAGE = 'serosim2', expected, data, error, MAX_TITRE)
}

vector_sort <- function(x) {
    .Call('_serosim2_vector_sort', PACKAGE = 'serosim2', x)
}

vector_order <- function(x) {
    .Call('_serosim2_vector_order', PACKAGE = 'serosim2', x)
}

individual_sim <- function(mu_pars, tp_pars, m_pars, ti_pars, y0b, lower_titre_bound, times) {
    .Call('_serosim2_individual_sim', PACKAGE = 'serosim2', mu_pars, tp_pars, m_pars, ti_pars, y0b, lower_titre_bound, times)
}

multiple_sim <- function(ti_pars, y0s, mu_pars, tp_pars, m_pars, times) {
    .Call('_serosim2_multiple_sim', PACKAGE = 'serosim2', ti_pars, y0s, mu_pars, tp_pars, m_pars, times)
}

obs_error <- function(actual, obs, S, EA) {
    .Call('_serosim2_obs_error', PACKAGE = 'serosim2', actual, obs, S, EA)
}

posterior_1 <- function(ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, error_pars, mu_pop, mu_pop_sigma) {
    .Call('_serosim2_posterior_1', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, error_pars, mu_pop, mu_pop_sigma)
}

posterior_2 <- function(ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, pop_sigma, mu_pop, mu_pop_sigma, cr_pop, cr_sigmas) {
    .Call('_serosim2_posterior_2', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, pop_sigma, mu_pop, mu_pop_sigma, cr_pop, cr_sigmas)
}

posterior_3 <- function(ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, pop_sigma, mu_pop, mu_pop_sigma, cr_pop, m_pop, cr_sigmas, m_sigmas) {
    .Call('_serosim2_posterior_3', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, pop_sigma, mu_pop, mu_pop_sigma, cr_pop, m_pop, cr_sigmas, m_sigmas)
}

posterior_4 <- function(ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, error_pars, mu_pop, mu_pop_sigma) {
    .Call('_serosim2_posterior_4', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp_pars, m_pars, data, error_pars, mu_pop, mu_pop_sigma)
}

individual_sim_NEW <- function(mu_pars, tp, m, ti_pars, y0b, lower_titre_bound, times) {
    .Call('_serosim2_individual_sim_NEW', PACKAGE = 'serosim2', mu_pars, tp, m, ti_pars, y0b, lower_titre_bound, times)
}

posterior_NEW <- function(ti_pars, y0s, mu, cr_pars, tp, m, max_titre, sigma, mu_pop, mu_pop_sigma, data) {
    .Call('_serosim2_posterior_NEW', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp, m, max_titre, sigma, mu_pop, mu_pop_sigma, data)
}

model_NEW <- function(ti_pars, y0s, mu, cr_pars, tp, m, max_titre, sigma, mu_pop, mu_pop_sigma, ts) {
    .Call('_serosim2_model_NEW', PACKAGE = 'serosim2', ti_pars, y0s, mu, cr_pars, tp, m, max_titre, sigma, mu_pop, mu_pop_sigma, ts)
}

#' Converts to unit scale
#'
#' @param x the double to be converted
#' @param min the minimum value on the linear scale
#' @param max the maximum value on the linear scale
#' @return the value converted to a unit scale
#' @export
#' @useDynLib serosim2
toUnitScale <- function(x, min, max) {
    .Call('_serosim2_toUnitScale', PACKAGE = 'serosim2', x, min, max)
}
jameshay218/serosim2 documentation built on Nov. 29, 2017, 6:21 p.m.