LogLike.APFA: Log likelihood for an APFA model

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

View source: R/APFAfunctions.R

Description

Uses the edge probabilities from G to calculate the log likelihood of the model.

Usage

1

Arguments

G

a fitted APFA

dat

a data frame that contains the same variables that G is based on.

complete.cases

a Boolean that determines whether incomplete cases are included in the calculations (see Details).

Details

An observation in the data may not be in the sample space of the APFA, i.e. there may not a root-to-sink path in the APFA generating the observation. However, there will be a partial path, that is, generating the initial part of the observation. If complete.cases is true, such observations are excluded from the calculations, otherwise contributions from the partial path are included.

See the reference below for the per-symbol log-likelihood.

Value

Returns the log-likelihood and the per-symbol log-likelihood.

Author(s)

Smitha Ankinakatte and David Edwards

References

Thollard, F.; Dupont, P. & de la Higuera, C. Probabilistic DFA Inference using Kullback-Leibler Divergence and Minimality 17th International Conference on Machine Learning., 2000, 975-982;

Ankinakatte, S. and Edwards, D. Modelling discrete longitudinal data using acyclic probabilistic finite automata. Submitted to Computational Statistica and Data Analysis.

See Also

add.stats

Examples

1
2
3
4
5
6
library(gRapfa)
data(Wheeze)
G <- st(Wheeze)
samp <- sample(1:537, 250)
G <- select.IC(Wheeze[samp,])
G.LL  <- LogLike.APFA(G, Wheeze[-samp,])

gRapfa documentation built on May 2, 2019, 6:54 a.m.