Learn R Programming

multivarious

This package is intended to provide some basic abstractions and default implementations of basic computational infrastructure for multivariate component-based modeling such as principal components analysis.

The main idea is to model multivariate decompositions as involving projections from an input data space to a lower dimensional component space. This idea is encapsulated by the projector class and the project function. Support for two-way mapping (row projection and column projection) is provided by the derived class bi-projector. Generic functions for common operations are included:

  • project for mapping from input space into (usually) reduced-dimensional output space
  • partial_project for mapping a subset of input space into output space
  • project_vars for mapping new variables (“supplementary variables”) to output space
  • reconstruct for reconstructing input data from its low-dimensional representation
  • residuals for extracting residuals of a fit with n components.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("bbuchsbaum/multivarious")

Example

This is a basic example which shows you how to solve a common problem:

library(multivarious)
#> 
#> Attaching package: 'multivarious'
#> The following object is masked from 'package:stats':
#> 
#>     residuals
#> The following object is masked from 'package:base':
#> 
#>     truncate
## basic example code

Copy Link

Version

Install

install.packages('multivarious')

Monthly Downloads

183

Version

0.2.0

License

MIT + file LICENSE

Maintainer

Bradley Buchsbaum

Last Published

March 28th, 2024

Functions in multivarious (0.2.0)

compose_projector

Compose Two Projectors
discriminant_projector

Construct a Discriminant Projector
multiblock_biprojector

Create a Multiblock Bi-Projector
fresh

Get a fresh pre-processing node cleared of any cached data
nblocks

get the number of blocks
ncomp

Get the number of components
prinang

Compute principal angles for a set of subspaces
print.bi_projector

Pretty Print S3 Method for bi_projector Class
pca

Principal Components Analysis (PCA)
convert_domain

Transfer data from one input domain to another via common latent space
perm_ci

Permutation Confidence Intervals
classifier.projector

create classifier from a projector
classifier.multiblock_biprojector

Multiblock Bi-Projector Classifier
cross_projector

Two-way (cross) projection to latent components
reprocess.cross_projector

reprocess a cross_projector instance
residualize

Compute a regression model for each column in a matrix and return residual matrix
multiblock_projector

Create a Multiblock Projector
coef.cross_projector

Extract coefficients from a cross_projector object
group_means

Compute column-wise mean in X for each factor level of Y
partial_project

Partially project a new sample onto subspace
init_transform

initialize a transform
colscale

scale a data matrix
partial_projector

Construct a partial projector
partial_projector.projector

construct a partial_projector from a projector instance
pass

a no-op pre-processing step
project_vars

Project one or more variables onto a subspace
projector

Construct a projector instance
shape.cross_projector

shape of a cross_projector instance
shape

Shape of the Projector
sdev

standard deviations
standardize

center and scale each vector of a matrix
print.composed_projector

Pretty Print Method for composed_projector Objects
print.multiblock_biprojector

Pretty Print Method for multiblock_biprojector Objects
rf_classifier

construct a random forest wrapper classifier
prep

prepare a dataset by applying a pre-processing pipeline
predict.classifier

predict with a classifier object
rf_classifier.projector

create a random forest classifier
regress

Multi-output linear regression
reprocess

apply pre-processing parameters to a new data matrix
print.projector

Pretty Print Method for projector Objects
project_block

Project a single "block" of data onto the subspace
scores

Retrieve the component scores
project

New sample projection
rotate

Rotate a Component Solution
project.cross_projector

project a cross_projector instance
truncate

truncate a component fit
transpose

Transpose a model
partial_inverse_projection

Partial Inverse Projection of a Columnwise Subset of Component Matrix
print.bi_projector_union

Pretty Print S3 Method for bi_projector_union Class
nystrom_embedding

Nystrom method for out-of-sample embedding
reconstruct

Reconstruct the data
print.classifier

Pretty Print Method for classifier Objects
refit

refit a model
residuals

Obtain residuals of a component model fit
reverse_transform

reverse a pre-processing transform
std_scores

Compute standardized component scores
svd_wrapper

Singular Value Decomposition (SVD) Wrapper
add_node

add a pre-processing stage
block_indices

get block_indices
apply_rotation

Apply rotation
bi_projector

Construct a bi_projector instance
bootstrap

Bootstrap Resampling for Multivariate Models
apply_transform

apply a pre-processing transform
bi_projector_union

A Union of Concatenated bi_projector Fits
bootstrap.pca

PCA Bootstrap Resampling
center

center a data matrix
block_lengths

get block_lengths
classifier

Construct a Classifier
classifier.discriminant_projector

Create a k-NN classifier for a discriminant projector
components

get the components
compose_projectors

Projector Composition
inverse_projection

Inverse of the Component Matrix
concat_pre_processors

bind together blockwise pre-processors
is_orthogonal

is it orthogonal