NormMixParam: Calculate the mean and covariance for a Normal mixture model

Description Usage Arguments Value Author(s) Examples

View source: R/NormMixClus-functions.R

Description

Calculates the mean and covariance parameters for a normal mixture model of the form pK_Lk_Ck

Usage

1
2
3
4
5
6
7
8
NormMixParam(
  coseqResults,
  y_profiles = NULL,
  K = NULL,
  digits = 3,
  plot = FALSE,
  ...
)

Arguments

coseqResults

Object of class coseqResults or RangedSummarizedExperiment (as output from the NormMixClus or NormMixClusK functions)

y_profiles

y (n x q) matrix of observed profiles for n observations and q variables, required for x of class RangedSummarizedExperiment

K

The model used for parameter estimation for objects x of class coseq or NormMixClus. When NULL, the model selected by the ICL criterion is used; otherwise, K should designate the number of clusters in the desired model

digits

Integer indicating the number of decimal places to be used for output

plot

If true, produce heatmaps to visualize the estimated per-cluster correlation matrices

...

Additional optional parameters to pass to corrplot, if desired

Value

pi

Vector of dimension K with the estimated cluster proportions from the Gaussian mixture model, where K is the number of clusters

mu

Matrix of dimension K x d containing the estimated mean vector from the Gaussian mixture model, where d is the number of samples in the data y_profiles and K is the number of clusters

Sigma

Array of dimension d x d x K containing the estimated covariance matrices from the Gaussian mixture model, where d is the number of samples in the data y_profiles and K is the number of clusters

rho

Array of dimension d x d x K containing the estimated correlation matrices from the Gaussian mixture model, where d is the number of samples in the data y_profiles and K is the number of clusters

Author(s)

Andrea Rau, Cathy Maugis-Rabusseau

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Simulate toy data, n = 300 observations
set.seed(12345)
countmat <- matrix(runif(300*4, min=0, max=500), nrow=300, ncol=4)
countmat <- countmat[which(rowSums(countmat) > 0),]
profiles <- transformRNAseq(countmat, norm="none",
                            transformation="arcsin")$tcounts

conds <- rep(c("A","B","C","D"), each=2)

## Run the Normal mixture model for K = 2,3
## Object of class coseqResults
run <- NormMixClus(y=profiles, K=2:3, iter=5)
run

## Run the Normal mixture model for K=2
## Object of class SummarizedExperiment0
run2 <- NormMixClusK(y=profiles, K=2, iter=5)

## Summary of results
summary(run)

## Re-estimate mixture parameters for the model with K=2 clusters
param <- NormMixParam(run, y_profiles=profiles)

andreamrau/coseq documentation built on July 25, 2021, 10:17 a.m.