Exemplo n.º 1
0
        // this is different than EvalProb(x, error) as it uses the model (i.e., it does not traverse the tree)
        double EvalS(int x)
        {
            double s, tt;

            tt = s = 0;
            Model ms = models[seasonal];

            s = ms.Eval(x % freq, ref tt);
            return(s);
        }
Exemplo n.º 2
0
        // this is different than EvalProb(x, error) as it uses the model (i.e., it does not traverse the tree)
        double Eval(int x, ref double error)
        {
            double t, s;
            double xx, tt;

            //DModel *m= (DModel*)&(models[j]);
            if (seasonal == -1 && nv == 0)
            {
                return(ts[x]);
            }
            if (seasonal == -1)
            {
                return(values[0] * x + values[1]);
            }

            t = s = 0;
            if (type == ModelType.EXPLICIT)
            {
                t = values[x / freq];
            }
            else if (type == ModelType.IMPLICIT)
            {
                t = values[0] * x / freq + values[1];
            }
            else
            {
                t = values[0] * x + values[1];
            }
            Model ms = models[seasonal];

            tt = 0;
            s  = ms.Eval(x % freq, ref tt);
            xx = s + t;
            //	Console.Write("Total  %lf\n",xx);
            error = err;
            return(xx);
        }