R/RcppExports.R

Defines functions stappDP_merdecomp stappDP_mer_fit stappDP_fit

Documented in stappDP_fit stappDP_merdecomp stappDP_mer_fit

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

#' Penalized Functional Dirichlet Process Linear Regression with N observations
#'
#' @param y a vector of continuous outcomes
#' @param Z a matrix of population level confounders
#' @param X a matrix of spatial temporal aggregated predictors
#' @param w a vector of weights for weighted regression
#' @param alpha_a alpha gamma prior shape hyperparameter
#' @param alpha_b alpha gamma prior scale hyperparameter
#' @param sigma_a precision gamma prior shape hyperparameter
#' @param sigma_b precision gamma prior scale hyperparameter
#' @param tau_a penalty gamma prior shape hyperparameter
#' @param tau_b penalty gamma prior scale hyperparameter
#' @param K truncation number
#' @param subset_one rank of first smoothing matrix
#' @param subset_two rank of second smoothing matrix
#' @param threshold number of members per cluster at which cluster is included in regression
#' @param iter_max maximum number of iterations
#' @param burn_in number of burn in iterations
#' @param thin number by which to thin samples
#' @param seed rng initializer
#' @param num_posterior_samples total number of posterior samples
#' @param chain chain label
#' @param fix_alpha  boolean value that determines whether or not to fix alpha in sampler
#' @param logging boolean parameter indicating whether or not a single iteration should be run with print messages indicating successful completion of the Sampler's sub modules
stappDP_fit <- function(y, Z, X, w, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, num_posterior_samples, chain, fix_alpha, logging) {
    .Call(`_rstapDP_stappDP_fit`, y, Z, X, w, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, num_posterior_samples, chain, fix_alpha, logging)
}

#' Penalized Functional Dirichlet Process Linear Mixed Effects Regression
#'
#' fits a functional dirichlet process linear mixed effects regression model
#' with N observations and n subjects
#'
#' @param y a vector of continuous outcomes
#' @param Z a matrix of population level confounders
#' @param X a matrix of spatial temporal aggregated predictors
#' @param W a design matrix for group specific terms
#' @param w a vector of weights for weighted regression
#' @param subj_mat_ N x n sparse matrix used to aggregate subject observations
#' @param subj_n n x 1 vector of integers representing how many observations correspond to each subject
#' @param alpha_a alpha gamma prior shape hyperparameter
#' @param alpha_b alpha gamma prior scale hyperparameter
#' @param sigma_a precision gamma prior shape hyperparameter
#' @param sigma_b precision gamma prior scale hyperparameter
#' @param tau_a penalty gamma prior shape hyperparameter
#' @param tau_b penalty gamma prior scale hyperparameter
#' @param K truncation number
#' @param subset_one rank of first smoothing matrix
#' @param subset_two rank of second smoothing matrix
#' @param threshold number of members per cluster at which cluster is included in regression
#' @param iter_max maximum number of iterations
#' @param burn_in number of burn in iterations
#' @param thin number by which to thin samples
#' @param seed rng initializer
#' @param chain chain label
#' @param num_posterior_samples total number of posterior samples
#' @param fix_alpha  boolean value that determines whether or not to fix alpha in sampler
#' @param logging boolean parameter indicating whether or not a single iteration should be run with print messages indicating successful completion of the Sampler's sub modules
stappDP_mer_fit <- function(y, Z, X, W, w, subj_mat_, subj_n, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, chain, num_posterior_samples, fix_alpha, logging) {
    .Call(`_rstapDP_stappDP_mer_fit`, y, Z, X, W, w, subj_mat_, subj_n, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, chain, num_posterior_samples, fix_alpha, logging)
}

#' Penalized Functional Dirichlet Process Linear Mixed Effects Regression with Between-Within Decomposition
#'
#' fits a functional dirichlet process linear mixed effects regression model
#' with N observations and n subjects using a between-within effects decomposition on the STAP-DP design matrix 
#'
#' @param y a vector of continuous outcomes
#' @param Z a matrix of population level confounders
#' @param X_b Matrix of between subject spatial temporal aggregated predictor covariates
#' @param X_w Matrix of within subject spatial temporal aggregated predictor covariates
#' @param W a design matrix for group specific terms
#' @param w a vector of weights for weighted regression
#' @param subj_mat_ N x n sparse matrix used to aggregate subject observations
#' @param subj_n n x 1 vector of integers representing how many observations correspond to each subject
#' @param alpha_a alpha gamma prior shape hyperparameter
#' @param alpha_b alpha gamma prior scale hyperparameter
#' @param sigma_a precision gamma prior shape hyperparameter
#' @param sigma_b precision gamma prior scale hyperparameter
#' @param tau_a penalty gamma prior shape hyperparameter
#' @param tau_b penalty gamma prior scale hyperparameter
#' @param K truncation number
#' @param subset_one rank of first smoothing matrix
#' @param subset_two rank of second smoothing matrix
#' @param threshold number of members per cluster at which cluster is included in regression
#' @param iter_max maximum number of iterations
#' @param burn_in number of burn in iterations
#' @param thin number by which to thin samples
#' @param seed rng initializer
#' @param num_posterior_samples total number of posterior samples
#' @param chain chain label
#' @param fix_alpha  boolean value that determines whether or not to fix alpha in sampler
#' @param logging boolean parameter indicating whether or not a single iteration should be run with print messages indicating successful completion of the Sampler's sub modules
stappDP_merdecomp <- function(y, Z, X_b, X_w, W, w, subj_mat_, subj_n, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, num_posterior_samples, chain, fix_alpha, logging) {
    .Call(`_rstapDP_stappDP_merdecomp`, y, Z, X_b, X_w, W, w, subj_mat_, subj_n, alpha_a, alpha_b, sigma_a, sigma_b, tau_a, tau_b, K, subset_one, subset_two, threshold, iter_max, burn_in, thin, seed, num_posterior_samples, chain, fix_alpha, logging)
}
apeterson91/rstapDP documentation built on Sept. 20, 2023, 9:34 a.m.