WeightedPCA: PCA for heterogeneous quality samples
Documentation for WeightedPCA.
👋 This package provides research code and work is ongoing. If you are interested in using it in your own research, I'd love to hear from you and collaborate! Feel free to write: dahong67@wharton.upenn.edu
Please cite the following paper for this technique:
David Hong, Fan Yang, Jeffrey A. Fessler, Laura Balzano. "Optimally Weighted PCA for High-Dimensional Heteroscedastic Data", 2022. https://arxiv.org/abs/1810.12862
In BibTeX form:
@Misc{hyfb2022owp,
title = "Optimally Weighted PCA for High-Dimensional Heteroscedastic Data",
author = "David Hong and Fan Yang and Jeffrey A. Fessler and Laura Balzano",
year = 2022,
url = "https://arxiv.org/abs/1810.12862",
}
Docstrings
WeightedPCA.WeightedPCA
WeightedPCA.ComputedWeights
WeightedPCA.InverseVarianceWeights
WeightedPCA.OptimalWeights
WeightedPCA.UniformWeights
WeightedPCA.wpca
WeightedPCA.WeightedPCA
— ModuleWeighted PCA module. Provides weighted principal component analysis (PCA) for data with samples of heterogeneous quality (heteroscedastic noise).
WeightedPCA.wpca
— Functionwpca(Y, i, weights=UniformWeights())
Compute i
th principal component of data Y
via weighted PCA using weights
, i.e., output is the i
th eigenvector of the weighted sample covariance Σ_l w[l] Y[l]*Y[l]'
. Data Y
is a list of matrices (each column is a sample).
Choices for weights
UniformWeights()
: uniform weights, i.e.,w[l] = 1
[default]InverseVarianceWeights([v])
: inverse noise variance weights, i.e.,w[l] = 1/v[l]
OptimalWeights([v,λ])
: optimal weights for signal with varianceλ
, i.e.,w[l] = 1/v[l] * 1/(1+v[l]/λ)
The weights
can also be manually set by passing in an AbstractVector{<:Real}
.
See also: UniformWeights
, InverseVarianceWeights
, OptimalWeights
.
WeightedPCA.ComputedWeights
— TypeComputedWeights
Abstract supertype for weights that are computed from properties of the data.
WeightedPCA.UniformWeights
— TypeUniformWeights <: ComputedWeights
Uniform weighting, i.e., w[l] = 1
. Corresponds to conventional (unweighted) PCA.
WeightedPCA.InverseVarianceWeights
— TypeInverseVarianceWeights <: ComputedWeights
Inverse noise variance weighting, i.e., w[l] = 1/v[l]
.
Constructors
InverseVarianceWeights(v=noisevar)
for known noise variancesnoisevar
InverseVarianceWeights()
for unknown noise variances; noise variances will be estimated from data
WeightedPCA.OptimalWeights
— TypeOptimalWeights <: ComputedWeights
Optimal weighting, i.e., w[l] = 1/v[l] * 1/(1+v[l]/λ)
.
Constructors
OptimalWeights(v=noisevar, λ=signalvar)
for known noise variancesnoisevar
and signal variancesignalvar
OptimalWeights(λ=signalvar)
for known signal variancesignalvar
; noise variances will be estimated from dataOptimalWeights(v=noisevar)
for known noise variancesnoisevar
; signal variance will be estimated from dataOptimalWeights()
for unknown noise and signal variances; noise and signal variances will be estimated from data