lol.sims.mean_diff: Mean Difference Simulation

Description Usage Arguments Value Details Author(s) Examples

View source: R/simulations.R

Description

A function for simulating data in which a difference in the means is present only in a subset of dimensions, and equal covariance.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
lol.sims.mean_diff(
  n,
  d,
  rotate = FALSE,
  priors = NULL,
  K = 2,
  md = 1,
  subset = c(1),
  offdiag = 0,
  s = 1
)

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.

K

the number of classes. Defaults to 2.

md

the magnitude of the difference in the means in the specified subset of dimensions. Ddefaults to 1.

subset

the dimensions to have a difference in the means. Defaults to only the first dimension. max(subset) < d. Defaults to c(1).

offdiag

the off-diagonal elements of the covariance matrix. Should be < 1. S_{ij} = offdiag if i != j, or 1 if i == j. Defaults to 0.

s

the scaling parameter of the covariance matrix. S_ij = scaling*1 if i == j, or scaling*offdiag if i != j. Defaults to 1.

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.

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.mean_diff(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.