# Generated by using Rcpp::compileAttributes() -> do not edit by hand
# Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393
#' Function to update posterior for dirichlet concentration parameters.
#'
#' @param phi Current value of posterior dirichlet weights.
#' @param i Current iteration of the SUGS algorithm.
#' @param clustnew The cluster to which the \code{i}th observation has allocated.
#' @param n A vector indicating the number of observations allocated to each cluster.
#' @param betaHat The grid prior for the dirichlet concentration parameter.
#'
#' @return An update value for phi.
NULL
phiUpdatecpp <- function(phi, i, clustnew, n, betaHat) {
.Call('_sugsvarsel_phiUpdatecpp', PACKAGE = 'sugsvarsel', phi, i, clustnew, n, betaHat)
}
#' A C++ accelerated version of sugsclusterProb
#'
#' @param x A numeric vector containing data of the observation
#' @param K An integer specifiying the number of clusters
#' @param i An integer specifying the current iteration of SUGS algorithm
#' @param D An integer specifiying the number of variables
#' @param n A numeric vector contain the number of people already allocated to each cluster
#' @param betaHat A numeric vector containing the grid of hyperpriors for the dirichlet
#' concentration parameter
#' @param phi A numeric matrix containing the weights for the dirichlet hyperpiors
#' @param m A numeric matrix containing the means for each component
#' @param nu A numeric vector containg the degrees of freedom for each component
#' @param S A numeric matrix containing the scale prior for each component
#' @param lambda A numeric vector containing the mean variance hyperparamter for each component
#'
#' @return An arma::vec containg the probability that observation \code{x} belongs to each component
#' @export
sugsclusterProbcpp <- function(x, K, i, D, n, betaHat, phi, m, nu, S, lambda) {
.Call('_sugsvarsel_sugsclusterProbcpp', PACKAGE = 'sugsvarsel', x, K, i, D, n, betaHat, phi, m, nu, S, lambda)
}
#' A C++ accelerated version of sugsclusterMarg
#'
#' @param x A numeric vector containing data of the observation
#' @param K An integer specifiying the number of clusters
#' @param i An integer specifying the current iteration of SUGS algorithm
#' @param D An integer specifiying the number of variables
#' @param n A numeric vector contain the number of people already allocated to each cluster
#' @param betaHat A numeric vector containing the grid of hyperpriors for the dirichlet
#' concentration parameter
#' @param phi A numeric matrix containing the weights for the dirichlet hyperpiors
#' @param m A numeric matrix containing the means for each component
#' @param nu A numeric vector containg the degrees of freedom for each component
#' @param S A numeric matrix containing the scale prior for each component
#' @param lambda A numeric vector containing the mean variance hyperparamter for each component
#' @param intfeature A binary vector of feature which are parition as irrelevant (0) or relevant (1).
#'
#' @return An arma::vec containg the probability that observation \code{x} belongs to each component
#' @export
sugsclustMargcpp <- function(x, K, i, D, n, betaHat, phi, m, nu, S, lambda, intfeature) {
.Call('_sugsvarsel_sugsclustMargcpp', PACKAGE = 'sugsvarsel', x, K, i, D, n, betaHat, phi, m, nu, S, lambda, intfeature)
}
#' A C++ accelerated version of sugsnewclustMarg
#'
#' @inheritParams sugsclustMargcpp
#' @inheritParams sugsclustMarg
#' @inheritParams sugs
#' @return The unnormalised probability of belong to any of the currently unoccupied clusters.
sugsnewclustMargcpp <- function(x, i, D, phi, betaHat, mu_0, nu_0, S_0, lambda_0, intfeature) {
.Call('_sugsvarsel_sugsnewclustMargcpp', PACKAGE = 'sugsvarsel', x, i, D, phi, betaHat, mu_0, nu_0, S_0, lambda_0, intfeature)
}
#' A C++ accelerated version of sugscompPml
#'
#' @param X The data matrix with rows as observations
#' @inheritParams sugsclustMargcpp
#' @inheritParams sugs
#' @param N The total number of people to be clustered
#'
#' @return The log PML.
#' @export
sugscompPmlcpp <- function(X, K, N, D, n, phi, betaHat, m, nu, lambda, S, mu_0, nu_0, lambda_0, S_0) {
.Call('_sugsvarsel_sugscompPmlcpp', PACKAGE = 'sugsvarsel', X, K, N, D, n, phi, betaHat, m, nu, lambda, S, mu_0, nu_0, lambda_0, S_0)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.