public bool Equals(IHiddenMarkovModel <TDistribution> other) { if (!(VectorExtentions.EqualsTo(Pi, other.Pi) && TransitionProbabilityMatrix.EqualsTo(other.TransitionProbabilityMatrix) && N == other.N && M == other.M && Likelihood == other.Likelihood)) { return(false); } return(!Emission.Where((t, i) => !t.Equals(other.Emission[i])).Any()); }
public bool Equals(IDistribution other) { var d = other as MultivariateDiscreteDistribution; if (d == null) { //throw new ApplicationException("Incompatable types, other is not UnivariateDiscreteDistribution"); return(false); } return(VectorExtentions.EqualsTo(Variance, d.Variance) && VectorExtentions.EqualsTo(Mean, d.Mean) && Covariance.EqualsTo(d.Covariance) && Dimension == d.Dimension); }