# Likelihood for the models.

### Description

Likelihood functions for the implemented models.

### Usage

1 | ```
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

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

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.