Esempio n. 1
0
        private double CalculateNextX(Random rnd, DoubleSeries s, PFSeriesConfig c, Function f, string fHead, long i)
        {
            double t            = i / c.TimeQuotient;
            var    arg          = ConfigurationParser.ParseArgument("t", t);
            var    periodicPart = ConfigurationParser.ComputeFunction(fHead, f, arg);

            var ar_part_drivers = 0.0;
            var ma_part_drivers = 0.0;

            lock (seriesDict)
                CalculateDriverParts(c.Drivers, out ar_part_drivers, out ma_part_drivers);

            var et = rnd.NextGaussian_BoxMuller(c.Mean, c.StdDev); // next noise
            var xt = c.C + periodicPart + ar_part_drivers + ma_part_drivers + et;

            lock (seriesDict) {
                if (s.X.Count > MAX_BUFFER_SIZE)
                {
                    s.X.RemoveAt(0);
                }
                s.X.Add(xt);
            }

            return(xt);
        }
Esempio n. 2
0
        private double CalculateNextXSimple(Random rnd, DoubleSeries s, PFSeriesConfig c, Function f, string fHead, long i)
        {
            double t   = i / c.TimeQuotient;
            var    arg = ConfigurationParser.ParseArgument("t", t);
            var    xt  = ConfigurationParser.ComputeFunction(fHead, f, arg);

            s.X.Add(xt);
            return(xt);
        }