likelihood: Likelihood for the models.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Likelihood functions for the implemented models.

Usage

1

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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)

dmt documentation built on May 2, 2019, 5:49 p.m.

Related to likelihood in dmt...