Simulates Manly mixture dataset given the mixture parameters and sample size.

1 | ```
Manly.sim(n, la, tau, Mu, S)
``` |

`n ` |
sample size |

`la ` |
matrix of transformation parameters (K x p) |

`tau ` |
vector of mixing proportions (length K) |

`Mu ` |
matrix of mean vectors (K x p) |

`S ` |
array of covariance matrices (p x p x K) |

Simulates a Manly mixture dataset. Manly mixture data points are computed from back-transforming Gaussian distributed data points using user-specified transformation parameters 'la'.

`X ` |
the simulated Manly mixture dataset |

`id ` |
the simulated membership of the data |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
set.seed(123)
#sets the number of components, dimensionality and sample size
K <- 3
p <- 2
n <- 1000
#sets the parameters to simulate data from
tau <- c(0.25, 0.3, 0.45)
Mu <- matrix(c(12,4,4,12,4,10),3)
la <- matrix(c(1.2,0.5,1,0.5,0.5,0.7),3)
S <- array(NA, dim = c(p,p,K))
S[,,1] <- matrix(c(4,0,0,4),2)
S[,,2] <- matrix(c(5,-1,-1,3),2)
S[,,3] <- matrix(c(2,-1,-1,2),2)
#use function Manly.sim to simulate dataset with membership
A <- Manly.sim(n, la, tau, Mu, S)
#plot the data
plot(A$X, col = A$id)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.