Accord.Statistics.Models.Markov.Topology.Ergodic.Ergodic C# (CSharp) Method

Ergodic() public method

Creates a new Ergodic topology for a given number of states.
public Ergodic ( int states, bool random ) : System
states int The number of states to be used in the model.
random bool Whether to initialize the model with random probabilities /// or uniformly with 1 / number of states. Default is false (default is /// to use 1/states).
return System
        public Ergodic(int states, bool random)
        {
            if (states <= 0)
            {
                throw new ArgumentOutOfRangeException(
                    "states", "Number of states should be higher than zero.");
            }

            this.states = states;
            this.random = random;
            this.pi = new double[states];

            //for (int i = 0; i < pi.Length; i++)
            //    pi[i] = 1.0 / states;
            pi[0] = 1.0;
        }

Same methods

Ergodic::Ergodic ( int states ) : System