Learn R Programming

maxstablePCA (version 0.1.1)

reconstruct: Obtain reconstructed data for PCA

Description

Map the data to the reconstruction given by the fit of the max_stable_prcomp function. This is done by taking the max-matrix product of the data and the reconstruction matrix from the fit.

Usage

reconstruct(fit, data)

Value

An array of shape nrow(data), p giving the encoded representation of the data in p components which are also unit Frechet distributed which is to be takin into consideration for further analysis.

Arguments

fit,

max_stable_prcomp object. Data should be assumed to follow the same distribution as the data used in max_stable_prcomp.

data,

array with same number of columns as the data of the fit object.

See Also

max_stable_prcomp(), maxmatmul()

Examples

Run this code
# generate some data with the desired margins
dat <- matrix(evd::rfrechet(300), 100, 3)
maxPCA <- max_stable_prcomp(dat, 2)

#  look at summary to obtain further information about 
# loadings the space spanned and loss function
summary(maxPCA)

# transfrom data to compressed representation
# for a representation that is p-dimensional,
# preserves the max-stable structure and is numeric solution to 
# optimal reconstruction.
compr <- compress(maxPCA, dat)

# For visual examination reconstruct original vector from compressed representation
rec <- reconstruct(maxPCA, dat)

Run the code above in your browser using DataLab