Example #1
0
    //CumulativeSignedError = Sum( E(t) )
    public static decimal CumulativeSignedError(ForecastTable dt, int IgnoreInitial)
    {
        string Filter = "Error Is Not Null AND Instance > " + IgnoreInitial.ToString();

        if (dt.Select(Filter).Length == 0)
        {
            return(0);
        }
        return((Decimal)dt.Compute("SUM(Error)", Filter));
    }
Example #2
0
    //MeanAbsolutePercentError = Sum( |PercentError| ) / n
    public static decimal MeanAbsolutePercentError(ForecastTable dt, int IgnoreInitial)
    {
        string Filter = "AbsolutePercentError Is Not Null AND Instance > " + IgnoreInitial.ToString();


        if (dt.Select(Filter).Length == 0)
        {
            return(1);
        }
        return((Decimal)dt.Compute("AVG(AbsolutePercentError)", Filter));
    }
Example #3
0
    //CumulativeAbsoluteError = Sum( |E(t)| )
    public static decimal CumulativeAbsoluteError(ForecastTable dt, bool Holdout, int IgnoreInitial)
    {
        string Filter = "AbsoluteError Is Not Null AND Instance > " + IgnoreInitial.ToString();

        if (Holdout)
        {
            Filter += " AND Holdout=True";
        }

        if (dt.Select(Filter).Length == 0)
        {
            return(0);
        }
        return((Decimal)dt.Compute("SUM(AbsoluteError)", Filter));
    }