R/RcppExports.R

Defines functions cppRegmixPMLE

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

#' @description Updates parameter estimates of a finite mixture of
#' Gaussian regressions by the EM algorithm.
#' @export
#' @title cppRegmixPMLE
#' @name cppRegmixPMLE
#' @param bs (m-1) + (q+1)m + p by ninits matrix of initial values of (alpha,mu,beta,sigma,gamma).
#' @param ys n by 1 vector of data for y.
#' @param xs x n by q matrix of data for x.
#' @param zs n by p matrix of regressor associated with gamma.
#' @param mu0s m-1 vector of the estimate of mu from an m-1 component model.
#' @param sigma0s m-1 vector of the estimate of sigma from an m-1 component model.
#' @param m number of components in the mixture.
#' @param p dimension of the regressor associated with gamma.
#' @param an tuning parameter.
#' @param maxit maximum number of iterations.
#' @param ninits number of initial values.
#' @param tol Convergence is declared when the penalized log-likelihood increases by less than \code{tol}.
#' @param tau tau used to split the h-th component.
#' @param h h used as index for pivoting.
#' @param k number of EM steps taken in computing the modified EM statisic.
#' @return  A list with items:
#' \item{penloglikset}{vector of the maximized value of the penalized log-likelihood.}
#' \item{loglikset}{vector of the maximized value of the log-likelihood.}
#' \item{notcg}{vector that records whether EM steps converged or not for each initial value.}
#' \item{post}{n*m by ininits matrix of posterior probabilities for observations.}
#'
cppRegmixPMLE <- function(bs, ys, xs, zs, mu0s, sigma0s, m, p, an, maxit = 2000L, ninits = 10L, tol = 1e-8, tau = 0.5, h = 0L, k = 0L) {
    .Call('_subgroupLRT_cppRegmixPMLE', PACKAGE = 'subgroupLRT', bs, ys, xs, zs, mu0s, sigma0s, m, p, an, maxit, ninits, tol, tau, h, k)
}
kshimotsu/subgroupLRT documentation built on Feb. 8, 2023, 1:49 p.m.