lol.sims.rtrunk: Random Trunk

Description Usage Arguments Value Details Author(s) Examples

View source: R/simulations.R

Description

A simulation for the random trunk experiment, in which the maximal covariant dimensions are the reverse of the maximal mean differences.

Usage

1
2
3
4
5
6
7
8
9
lol.sims.rtrunk(
  n,
  d,
  rotate = FALSE,
  priors = NULL,
  b = 4,
  K = 2,
  maxvar = 100
)

Arguments

n

the number of samples of the simulated data.

d

the dimensionality of the simulated data.

rotate

whether to apply a random rotation to the mean and covariance. With random rotataion matrix Q, mu = Q*mu, and S = Q*S*Q. Defaults to FALSE.

priors

the priors for each class. If NULL, class priors are all equal. If not null, should be |priors| = K, a length K vector for K classes. Defaults to NULL.

b

scalar for mu scaling. Default to 4.

K

number of classes, should be <=4. Defaults to 2.

maxvar

the maximum covariance between the two classes. Defaults to 100.

Value

A list of class simulation with the following:

X

[n, d] the n data points in d dimensions as a matrix.

Y

[n] the n labels as an array.

mus

[d, K] the K class means in d dimensions.

Sigmas

[d, d, K] the K class covariance matrices in d dimensions.

priors

[K] the priors for each of the K classes.

simtype

The name of the simulation.

params

Any extraneous parameters the simulation was created with.

robust

If robust is not false, a list containing inlier a boolean array indicating which points are inliers, s.outlier the covariance structure of outliers, and mu.outlier the means of the outliers.

Details

For more details see the help vignette: vignette("sims", package = "lolR")

Author(s)

Eric Bridgeford

Examples

1
2
3
library(lolR)
data <- lol.sims.rtrunk(n=200, d=30)  # 200 examples of 30 dimensions
X <- data$X; Y <- data$Y

neurodata/lol documentation built on March 3, 2021, 1:46 a.m.