ExpectationMaximizationPCA.EMPCA!
— MethodEMPCA!(basis_vecs, scores, μ, data_tmp, weights; use_log, kwargs...)
Performs in-place (modifying basis_vecs
, scores
, and data_tmp
) expectation-maximization principal component analysis (EMPCA) on data_tmp
using weights
as the weights.
Keyword Arguments
use_log::false
: whether you want to perform EMPCA on the log ofdata
insteadinds::AbstractUnitRange=axes(basis_vecs, 2)
: which indices ofbasis_vecs
you want to usevec_by_vec::Bool=true
: whether you want to perform EMPCA one vector at a time (generally preffered) or all at once
ExpectationMaximizationPCA.EMPCA
— MethodEMPCA(μ, n_comp, data, weights; basis_vecs, scores, kwargs...)
Performs expectation-maximization principal component analysis (EMPCA) on data
with n_comp
basis vectors using weights
as the weights. Pre-allocated arrays for basis_vecs
, and scores
, can be passed via keyword arguments.
ExpectationMaximizationPCA._empca_all_at_once!
— Method_empca_all_at_once!(basis_vec, scores, data, weights; niter, kwargs...)
Performs in-place EMPCA, improving all basis vectors and scores with each iteration
Keyword Arguments
niter::Int=100
: the amount of iterations used
ExpectationMaximizationPCA._empca_vec_by_vec!
— Method_empca_vec_by_vec!(basis_vec, scores, data, weights; niter, kwargs...)
Performs in-place EMPCA, finishing one basis vector (and its scores) before moving onto the next
Keyword Arguments
niter::Int=100
: the amount of iterations used
ExpectationMaximizationPCA._random_orthonormal!
— Method_random_orthonormal!(A)
Fill A
with orthonormal basis vectors
ExpectationMaximizationPCA._reorthogonalize!
— Method_reorthogonalize!(basis_vec)
Modifies basis_vec
to ensure all basis vectors are orthagonal and normalized
ExpectationMaximizationPCA._reorthogonalize_no_renorm!
— Method_reorthogonalize!(basis_vec1, basis_vec2)
Modifies basis_vec1
to be orthagonal to basis_vec2
without normalizing
ExpectationMaximizationPCA._reorthogonalize_vec_i!
— Method_reorthogonalize!(basis_vec, i)
Modifies basis_vec[:, i]
to ensure it orthagonal to basis_vec[:, 1:i-1]
and normalized
ExpectationMaximizationPCA._solve
— Method_solve(dm, data, w)
Get optimal score(s) for modeling data
with the basis vectors in the design matrix (dm
) with weights (w
) using generalized least squares (GLS)
ExpectationMaximizationPCA._solve_eigenvectors!
— Method_solve_eigenvectors!(basis_vecs, scores, data, weights)
Fill basis_vecs
with those that optimally model data
with the scores
and weights (w
)
ExpectationMaximizationPCA._solve_eigenvectors!
— Method_solve_eigenvectors!(basis_vecs, scores, data, weights)
Fill basis_vec
with the one that optimally model data
with the scores
and weights (w
)
ExpectationMaximizationPCA._solve_scores!
— Method_solve_scores!(basis_vecs, scores, data, weights)
Fill scores
with those that optimally model data
with the basis_vecs
and weights (w
) using generalized least squares (GLS)+
ExpectationMaximizationPCA._solve_scores!
— Method_solve_scores!(basis_vec, scores, data, weights)
Fill scores
with those that optimally model data
with the basis_vec
and weights (w
) using generalized least squares (GLS)