Learn R Programming

dmt (version 0.8.20)

pfa.neg.log.likelihood: Likelihood for the models.

Description

Likelihood functions for the implemented models.

Usage

pfa.neg.log.likelihood(Wvec, phi, X)

Arguments

Wvec
Parameter vector which is converted in the latent covariance structure used in PFA, correspond to W*t(W) in the model X = Wz + epsilon.
phi
Marginal covariance in the model X = Wz + epilon with epsilon ~ N(0, phi).
X
Data: features x samples matrix.

Value

Details

Other likelihood functions will be added later.

References

See citation("dmt").

See Also

fit.dependency.model, pfa

Examples

Run this code
library(dmt)
# Generate toydata
N <- 100
xdim <- 10
zdim <- 3
toy <- generate.toydata(N = N, zDim = zdim, xDim = xdim, yDim = xdim, 
               marginal.covariances = "diagonal")
# Estimate model parameters
res <- pfa(toy$X, zDimension = zdim)
W <- res@W$total
phi <- res@phi$total
# wtw <- crossprod(t(W)) # is the same as W * t(W)
# Calculate negative log-likelihood for the model
L <- pfa.neg.log.likelihood(W, phi,toy$X)

Run the code above in your browser using DataLab