pfa.neg.log.likelihood {dmt}R Documentation

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.

Details

Other likelihood functions will be added later.

Value

Log-likelihood of the data, given the model parameters.

Author(s)

Leo Lahti leo.lahti@iki.fi

References

See citation("dmt").

See Also

fit.dependency.model, pfa

Examples

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)

[Package dmt version 0.8.20 Index]