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

Forward() public method

Creates a new Forward topology for a given number of states.
public Forward ( int states, int deepness, bool random ) : System
states int The number of states to be used in the model.
deepness int The maximum number of forward transitions allowed /// for a state. Default is to use the same as the number of states (all forward /// connections are allowed).
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 Forward(int states, int deepness, bool random)
        {
            if (states <= 0)
            {
                throw new ArgumentOutOfRangeException(
                    "states", "Number of states should be higher than zero.");
            }

            if (deepness > states)
            {
                throw new ArgumentOutOfRangeException(
                    "states", "Deepness level should be lesser or equal to the number of states.");
            }


            this.states = states;
            this.deepness = deepness;
            this.random = random;

            this.pi = new double[states];
            this.pi[0] = 1.0;
        }

Same methods

Forward::Forward ( int states ) : System
Forward::Forward ( int states, bool random ) : System
Forward::Forward ( int states, int deepness ) : System