Unlimited learning, half price | 50% off
Get 50% off unlimited learning

ssMRCD (version 1.1.0)

plot_scores: Plots of score distribution

Description

Plots of score distribution

Usage

plot_scores(X, PC, groups, ssMRCD, ...)

Value

Returns histograms of scores for component k.

Arguments

X

data matrix.

PC

loadings from PCA.

groups

vector containing group assignments.

ssMRCD

ssMRCD object.

...

other input arguments, see details.

Details

Additional parameters that can be given to the function are:

shapepoint shape
sizepoint size
alphatransparency
kinteger, which component scores should be plotted

Examples

Run this code
# set seed
set.seed(236)

data = matrix(rnorm(2000), ncol = 4)
groups = sample(1:10, 500, replace = TRUE)
W = time_weights(N = 10, c(3,2,1))

# calculate covariance matrices
covs = ssMRCD(data, groups = groups, weights = W, lambda = 0.3)

# sparse PCA
pca = sparsePCAloc(eta = 0.3, gamma = 0.7, cor = FALSE, COVS = covs$MRCDcov,
             n_max = 1000, increase_rho = list(TRUE, 50, 1), trace = FALSE)

# plot score distances
plot_scores(PC = pca$PC,
            groups = groups,
            X = data,
            ssMRCD = covs,
            k = 1,
            alpha = 0.4,
            shape = 16,
            size = 2)

Run the code above in your browser using DataLab