StpcaModel-class: Structured PCA Model

Description Fields Methods

Description

Structured PCA Model

Fields

X

The matrix of data

n

The number of samples

k

Latent dimensionality

d

Simensionality of observations

beta

Covariance function hyperparameters

K

covariance matrix generated from the covariance function and hyperparameters

KD

Partial derivatived of K w.r.t each of the hyperparameters

locs

Locations (t_i)

covFn

Covariance function

covFnD

Function giving partial derivatives of covariance function w.r.t hyperparameters

muHat

MAP estimate of mu

WHat

MAP estimate of W

sigSqHat

MAP estimate of sigSq

Vmean

The posterior mean of each latent variable

VVar

The posterior variance around each latent variable

logEvidence

log of the approximate evidence

logPosteriors

sequence of posteriors obtained in fitting. Un-normalised if sparse

logEvidenceD

Partial derivatives of evidence w.r.t hyperparameters

H

The precision matrix for the gaussian approximation to the posterior around each w

maxim

the maximisation object returned in hyperparameter tuning

thetaConv

Whether theta has been optimised to convergence (if false, beta has probably converged, not theta)

theta

betaHist history of betas in optimisation

convergence

History of logEvidence and logPosteror; used to assess convergence

sparse

whether this is a sparse stpca model

b

The sparsity hyperparameter in a sparse model.

Methods

crossvalidate(nFolds = 3, nThreads = 1)

Perform k-fold cross-validation (possibly multithreaded) to determine the held out log likelihood of examples. This could be used as an alternative to computing the approximate evidence in model selection.

decode(Vnew)

Decode points in the latent space into observations

encode(Xnew)

Encode a matrix of observations into latent distributions.

set_b(bNew)

Setter for 'b'

set_beta(betaNew)

Sets beta to a new value, recomputes K, KD and H.

set_locs(locsNew)

Sets the locations, and recomputes K. Be careful with this method. Does not update theta

set_sparse(spNew, b)

Setter for 'sparse'

set_X(Xnew)

Sets X, updates mu. Does not opdate anything else so it is recommended to call update() or something. Be careful with this method.

simulate(n = 1, Wknown = TRUE)

Simulates new synthetic data from a fitted model.

update(tune.maxit = 10, tune.tol = 1e-05, EM.maxit = 500, EM.bftol = 1e-05, ...)

The major method for performing inference. This iterates between updating theta (using update_theta) and updating beta (using update_beta).

update_beta(...)

Optimises the approximate evidence with respect to the hyperparameters.

update_theta(maxit = 500, bftol = 1e-05)

Finds the MAP theta using EM.


JimSkinner/spca documentation built on May 7, 2019, 10:52 a.m.