A simulation for the reversed random trunk experiment, in which the maximal covariant directions are the same as the directions with the maximal mean difference.
lol.sims.rev_rtrunk(
n,
d,
robust = FALSE,
rotate = FALSE,
priors = NULL,
b = 4,
K = 2,
maxvar = b^3,
maxvar.outlier = maxvar^3
)the number of samples of the simulated data.
the dimensionality of the simulated data.
the number of outlier points to add, where outliers have opposite covariance of inliers. Defaults to FALSE, which will not add any outliers.
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.
scalar for mu scaling. Default to 4.
number of classes, should be <4. Defaults to 2.
the maximum covariance between the two classes. Defaults to 100.
the maximum covariance for the outlier points. Defaults to maxvar*5.
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.
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.
For more details see the help vignette:
vignette("sims", package = "lolR")
# NOT RUN {
library(lolR)
data <- lol.sims.rtrunk(n=200, d=30) # 200 examples of 30 dimensions
X <- data$X; Y <- data$Y
# }
Run the code above in your browser using DataLab