A function for simulating data in which a difference in the means is present only in a subset of dimensions, and equal covariance.
lol.sims.mean_diff(
n,
d,
rotate = FALSE,
priors = NULL,
K = 2,
md = 1,
subset = c(1),
offdiag = 0,
s = 1
)the number of samples of the simulated data.
the dimensionality of the simulated data.
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.
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.
the number of classes. Defaults to 2.
the magnitude of the difference in the means in the specified subset of dimensions. Ddefaults to 1.
the dimensions to have a difference in the means. Defaults to only the first dimension. max(subset) < d. Defaults to c(1).
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.
the scaling parameter of the covariance matrix. S_ij = scaling*1 if i == j, or scaling*offdiag if i != j. Defaults to 1.
A list of class simulation with the following:
[n, d] the n data points in d dimensions as a matrix.
[n] the n labels as an array.
[d, K] the K class means in d dimensions.
[d, d, K] the K class covariance matrices in d dimensions.
[K] the priors for each of the K classes.
The name of the simulation.
Any extraneous parameters the simulation was created with.
For more details see the help vignette:
vignette("sims", package = "lolR")
# NOT RUN {
library(lolR)
data <- lol.sims.mean_diff(n=200, d=30) # 200 examples of 30 dimensions
X <- data$X; Y <- data$Y
# }
Run the code above in your browser using DataLab