Mixtures of Perturbed Kernels
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
R
examples
man
src
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
NAMESPACE
README.md

README.md

Variability decomposition across related mixture distributions

This package fits MPK, an algorithm to compare multiple related mixture distributions.

Install

The package can be installed using devtools:

install.packages('devtools')
library('devtools')
devtools::install_github('jacsor/MPK')

Use

There are five functions in this package, and their descriptions are provided in the help files

ans = mpk(Y, C)
state = getFinalState(ans)
plotDiff(ans)
cal = calibrate(ans)
score = getScore(ans)

Example

n = c(250, 250)
p = 4
Y1 = rbind( matrix( rnorm( n[1]*p), ncol = p), matrix( rnorm(n[2]*p) + 3, ncol = p))
Y2 = rbind( matrix( rnorm( n[1]*p), ncol = p), matrix( rnorm(n[2]*p) + 4, ncol = p))
Y = rbind(Y1, Y2)
C = c( rep(1,sum(n)), rep(2,sum(n)))
ans = mpk(Y, C)  
plotDiff(ans, type = "weight")
plotDiff(ans, type = "shift")
cal = calibrate(ans)
par(mfrow=c(1,2))
plot(Y, col = C)
plot(cal$Y_cal, col = C)

Reference

To do.