R/RcppExports.R

Defines functions rtruncnorm eStep mStep gibbsStep

Documented in eStep gibbsStep mStep rtruncnorm

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

#' @title
#' Random Number From a Truncated Normal
#' @description
#' Draw from a truncated normal
#' 
#' @param y is the value at which we want to left-truncated our normal distribution
#' @param mu is the mean of the truncated normal
#' @param sigma is the s.d. of the truncated normal
#' @param K is the number of replication of draws
#' @export
rtruncnorm <- function(y, mu, sigma, K = 1L) {
    .Call('DPsurv_rtruncnorm', PACKAGE = 'DPsurv', y, mu, sigma, K)
}

#' @title
#' eStep
#' @description
#' Determines to which cluster belongs an obervation, and a group of observations.
#' 
#' @param theta
#' @param phi
#' @param w
#' @param DataStorage
#' @export
eStep <- function(data, censoring, theta, phi, w) {
    .Call('DPsurv_eStep', PACKAGE = 'DPsurv', data, censoring, theta, phi, w)
}

#' @title
#' mStep
#' @description
#' Return the parameters' posterior.
#' 
#' @param DP
#' @param DataStorage
#' @param xi
#' @param zeta
#' @export
mStep <- function(prior, posterior, data, xi, zeta) {
    .Call('DPsurv_mStep', PACKAGE = 'DPsurv', prior, posterior, data, xi, zeta)
}

#' @title
#' Augment censored data using a Gibbs step
#' @description
#' Augment censored data by drawing them from a truncated normal
#' 
#' @param DP is an S4 object of type DP, HDP, or NDP.
#' @param DataStore is an S4 object of the same name.
#' @param xi is an integer vector that describes to which cluster belong an observation
#' @param zeta is an integer vector that describes in which cluster belong a group of observations
#' @export
gibbsStep <- function(DP, DataStorage, xi, zeta) {
    .Call('DPsurv_gibbsStep', PACKAGE = 'DPsurv', DP, DataStorage, xi, zeta)
}
AlexPiche/DPsurv documentation built on May 5, 2019, 4:52 a.m.