LogLikeVar: Log likelihood of the CemCO algorithm with covariates effects...

View source: R/cemco.R

LogLikeVarR Documentation

Log likelihood of the CemCO algorithm with covariates effects on distributions means and distributions covariance matrices.

Description

Returns the log-likelihood of the CemCO algorithm with covariates effects on distributions means and distributions covariance matrices.

Usage

LogLikeVar(data, Y, phi, G, y_cov)

Arguments

data

A numeric vector, matrix, or data frame of observations. Non-numerical values should be converted to integer or float (e.g. dummies). If matrix or data frame, rows and columns correspond to observations (n) and variables (P).

Y

numeric matrix of data to use as covariates. Non-numerical values should be converted to integer or float (e.g. dummies).

phi

list of fitted parameters in the same format as the output of the CemCO function.

G

An integer specifying the numbers of mixture components (clusters).

y_cov

numeric matrix of data to use as covariates for the covariance effect. Non-numerical values should be converted to integer or float (e.g. dummies).

Details

Calculate the log likelihood of the mixture guassian distribution given by the CemCO algorithm with covariates effects on distributions means and distributions covariance matrices. This function is used in the optimization process of the EM algorithm used to estimate the CemCO parameters.

Value

Return the value of the log likelihood.

Author(s)

Relvas, C. & Fujita, A.

References

Stage I non-small cell lung cancer stratification by using a model-based clustering algorithm with covariates, Relvas et al.

Examples

set.seed(42)
X = cbind(rnorm(10), rnorm(10))
Y = cbind(rnorm(10), rnorm(10))
K = 2

fit <- CemCOVar(X, Y, K, Y[,1], max_iter=2  , n_start=1, cores=1)
ll <- LogLikeVar(X, Y, fit[[1]], K, Y[,1])

cemco documentation built on April 25, 2023, 9:12 a.m.

Related to LogLikeVar in cemco...