/// <summary>
/// Predicts the next observation occurring after a given observation sequence.
/// </summary>
///
public double[] Predict(double[] observations, int next, out double logLikelihood)
{
if (multivariate)
{
throw new ArgumentException("Model is multivariate.", "observations");
}
if (observations == null)
{
throw new ArgumentNullException("observations");
}
// Convert to multivariate observations
double[][] obs = MarkovHelperMethods.convertNoCheck(observations, dimension);
// Matrix to store the probabilities in assuming the next
// observations (prediction) will belong to each state.
double[][] weights;
// Compute the next observations
double[][] prediction = predict(obs, next, out logLikelihood, out weights);
// Return the first (single) dimension of the next observations.
return(Accord.Math.Matrix.Concatenate(prediction));
}