plotmixt {ks}R Documentation

Plot for 2- and 3-dimensional normal and t-mixture density functions.

Description

Plot for 2- and 3-dimensional normal and t-mixture density functions.

Usage

plotmixt(mus, Sigmas, props, dfs, dist="normal", ...)

Arguments

mus (stacked) matrix of mean vectors
Sigmas (stacked) matrix of variance matrices
props vector of mixing proportions
dfs vector of degrees of freedom
dist "normal" - normal mixture, "t" - t-mixture
... other graphics parameters

Details

See the graphics parameter options in ?plot.kde.

Value

2-d plot is sent to graphics window; 3-d plot to RGL window.

Examples


## bivariate example
mus <- rbind(c(0,0), c(-1,1))
Sigma <- matrix(c(1, 0.7, 0.7, 1), nr=2, nc=2) 
Sigmas <- rbind(Sigma, Sigma)
props <- c(1/2, 1/2)
plotmixt(mus, Sigmas, props)
plotmixt(mus, Sigmas, props, dfs=c(3,8), dist="t")

## trivariate example
mus <- rbind(c(0,0,0), c(-1,1,1))
Sigma <- matrix(c(1, 0.7, 0.7, 0.7, 1, 0.7, 0.7, 0.7, 1), nr=3, nc=3) 
Sigmas <- rbind(Sigma, Sigma)
props <- c(1/2, 1/2)
plotmixt(mus, Sigmas, props)
plotmixt(mus, Sigmas, props,  dfs=c(3,8), dist="t")

[Package ks version 1.6.2 Index]