cross.validate(Data, K = 10, crit = NULL, beagle = TRUE, dir='')
beagle=TRUE
, the function performs model selection using BEAGLE.
K
subsets of equal sizes.\
2. At each cross validation step in k=1:K
, $k^th$ subset is taken as the test data
and the rest as training data.\
3. APFA model is fitted to the training data using a model selection method (AIC, BIC or Beagle),
then using the edge probabilities of the fitted model, the loglikelihood and the per-symbol loglikelihood
are calculated for the test data set.\
4. The function returns the mean of the log-likelihood from K-cross validation and pzero. \