Пример #1
0
 public void SetData(SeriesVariable dependentVariable, SeriesVariables independentVariables, LinearRegressionAnalysisForm.LRSpecification lrProperties)
 {
     this.dependentVariable    = dependentVariable;
     this.independentVariables = independentVariables;
     this.lrProperties         = lrProperties;
     this.update();
 }
Пример #2
0
 public void SetData(SeriesData data, SeriesVariable variable, double[] detrend)
 {
     this.variable = variable;
     this.data     = data;
     this.detrend  = detrend;
     this.update();
 }
Пример #3
0
 public void SetData(SeriesVariable variable, SeriesData data)
 {
     this.variable = variable;
     this.data     = data;
     this.variable.SeriesValues.Changed += new ChangedEventHandler(SeriesValues_Changed);
     this.update();
 }
Пример #4
0
 public void SetData(SeriesData data, SeriesVariable variable, double[] forecasted)
 {
     this.variable   = variable;
     this.data       = data;
     this.forecasted = forecasted;
     this.update();
 }
Пример #5
0
 public void SetData(SeriesData data, SeriesVariable variable, double[] residual)
 {
     this.variable = variable;
     this.data     = data;
     this.residual = residual;
     this.update();
 }
        /// <summary>
        /// Mengeset variabel yang telah dipilih
        /// </summary>
        /// <param name="variable">SeriesVariable. variable</param>
        public void SetVariable(SeriesVariable variable)
        {
            this.variable = variable;

            this.decProperties.seasonalLength = 2;

            this.Text = "Decomposition : " + variable.VariableName;

            // Create the ToolTip and associate with the Form container.
            ToolTip toolTip2 = new ToolTip();

            // Set up the delays for the ToolTip.
            toolTip2.AutoPopDelay = 500000000;
            toolTip2.InitialDelay = 100;
            toolTip2.ReshowDelay  = 1;
            //Force the ToolTip text to be displayed whether or not the form is active.
            toolTip2.ShowAlways = true;

            toolTip2.SetToolTip(this.SeasonalLengthBox, "SEASONAL LENGTH:\nThe length of one seasonal cycle\n\n"
                                + "RANGE:\nPossible seasonal length range for '"
                                + this.variable.VariableName + "' are 2 to " + this.variable.SeriesValuesNoNaN.Count / 2);
            toolTip2.SetToolTip(this.groupBox1, "SEASONAL LENGTH:\nThe length of one seasonal cycle\n\n"
                                + "RANGE:\nPossible seasonal length range for '"
                                + this.variable.VariableName + "' are 2 to " + this.variable.SeriesValuesNoNaN.Count / 2);

            this.UpdateSettings();
        }
        public void SetStock(SeriesStock stock)
        {
            this.stock               = stock;
            this.txtName.Text        = stock.StockName;
            this.txtDescription.Text = stock.StockDescription;

            this.openVariable = stock.Open;
            this.lstVariables.Items.Remove(stock.Open);
            this.txtOpen.Text = this.openVariable.VariableName;
            this.cmdOpen.Text = "<";

            this.highVariable = stock.High;
            this.lstVariables.Items.Remove(stock.High);
            this.txtHigh.Text = this.highVariable.VariableName;
            this.cmdHigh.Text = "<";

            this.lowVariable = stock.Low;
            this.lstVariables.Items.Remove(stock.Low);
            this.txtLow.Text = this.lowVariable.VariableName;
            this.cmdLow.Text = "<";

            this.closeVariable = stock.Close;
            this.lstVariables.Items.Remove(stock.Close);
            this.txtClose.Text = this.closeVariable.VariableName;
            this.cmdClose.Text = "<";

            this.volumeVariable = stock.Volume;
            this.lstVariables.Items.Remove(stock.Volume);
            this.txtVolume.Text = this.volumeVariable.VariableName;
            this.cmdVolume.Text = "<";
        }
Пример #8
0
 public void SetData(SeriesData data, SeriesVariable variable, double[] deseasonal)
 {
     this.variable   = variable;
     this.data       = data;
     this.deseasonal = deseasonal;
     this.update();
 }
Пример #9
0
        /// <summary>
        /// Metode dekomposisi klasik dengan rasio pada rata-rata bergerak
        /// </summary>
        /// <param name="variable">SeriesVariable. variabel yang akan dianalisis</param>
        /// <param name="seasonalLength">Integer. panjang satu siklus musiman</param>
        /// <param name="isMultiplikatif">Bool. apakah menggunakan metode multiplikatif?</param>
        /// <param name="initialTrend">Integer. Inisial model tren yang digunakan, 1-Linear, 2-Quadratic, 3-Cubic, 4-Exponential</param>
        public DecompositionClassic(SeriesVariable variable, int seasonalLength, bool isMultiplicative, int initialTrend)
        {
            this.variable = variable;
            Vector var = new Vector(this.variable.SeriesValuesNoNaN.ToArray());

            this.y = new Vector(var.Tuples);
            for (int i = 0; i < y.Tuples; i++)
            {
                this.y[i] = var[i];
            }

            this.n = y.Tuples;
            this.seasonalLength = seasonalLength;

            this.trend      = new double[this.n];
            this.detrend    = new double[this.n];
            this.seasonal   = new double[this.n];
            this.deseasonal = new double[this.n];
            this.predicted  = new double[this.n];
            this.residual   = new double[this.n];

            this.isMultiplicative = isMultiplicative;
            this.initialTrend     = initialTrend;

            if (this.isMultiplicative)
            {
                this.Multiplicative();
            }
            else
            {
                this.Additive();
            }

            this.ForecastingError();
        }
 public void SetData(SeriesData data, SeriesVariable variable, double[] predicted)
 {
     this.variable  = variable;
     this.data      = data;
     this.predicted = predicted;
     this.update();
 }
Пример #11
0
 public void SetData(SeriesData data, SeriesVariable variable, MovingAverageForm.MASpecification maProperties)
 {
     this.data             = data;
     this.variable         = variable;
     this.maProperties     = maProperties;
     this.lblVariable.Text = variable.VariableName;
     this.update();
 }
 public void SetData(SeriesVariable variable, SeriesData data)
 {
     this.variableDataGrid.SetData(variable, data);
     this.variableGraph.SetData(variable, data);
     this.variableStatistics.SetData(variable, data);
     this.Text = variable.VariableName;
     this.Name = "SERIES " + variable.VariableName;
 }
Пример #13
0
 public void SetData(SeriesData data, SeriesVariable variable, ExponentialSmoothingForm.ESSpecification esProperties)
 {
     this.data             = data;
     this.variable         = variable;
     this.esProperties     = esProperties;
     this.lblVariable.Text = variable.VariableName;
     this.update();
 }
Пример #14
0
 public void SetData(SeriesData data, SeriesVariable variable, DecompositionForm.DECSpecification decProperties)
 {
     this.data             = data;
     this.variable         = variable;
     this.decProperties    = decProperties;
     this.lblVariable.Text = variable.VariableName;
     this.update();
 }
Пример #15
0
 public void SetData(SeriesData data, SeriesVariable variable, TrendAnalysisForm.TrendSpecification trendProperties)
 {
     this.data             = data;
     this.variable         = variable;
     this.trendProperties  = trendProperties;
     this.lblVariable.Text = variable.VariableName;
     this.update();
 }
Пример #16
0
 public void SetData(SeriesData data, SeriesVariable variable, NeuralNetworkAnalysisForm.NetworkSpecification networkProperties)
 {
     this.data              = data;
     this.variable          = variable;
     this.networkProperties = networkProperties;
     this.lblVariable.Text  = variable.VariableName;
     this.update();
 }
Пример #17
0
 private void getSelectedVariable()
 {
     this.dependentVariable    = (SeriesVariable)this.lstDependent.Items[0];
     this.independentVariables = new SeriesVariables();
     foreach (Object item in this.lstIndependents.Items)
     {
         this.independentVariables.Add((SeriesVariable)item);
     }
 }
Пример #18
0
 public void SetData(SeriesData data, SeriesVariable variable, NeuralNetworkAnalysisForm.NetworkSpecification networkProperties,
                     double[] predicted, double[] forecasted)
 {
     this.data              = data;
     this.variable          = variable;
     this.predicted         = predicted;
     this.forecasted        = forecasted;
     this.networkProperties = networkProperties;
 }
 public void SetData(SeriesData data, SeriesVariable variable,
                     DecompositionForm.DECSpecification decProperties,
                     DecompositionForm.DECComponent decTable, double[] forecasted)
 {
     this.data          = data;
     this.variable      = variable;
     this.decProperties = decProperties;
     this.decTable      = decTable;
     this.forecasted    = forecasted;
 }
Пример #20
0
 public void SetData(SeriesData data, SeriesVariable variable,
                     ExponentialSmoothingForm.ESSpecification esProperties,
                     ExponentialSmoothingForm.ESComponent esTable, double[] forecasted)
 {
     this.data         = data;
     this.variable     = variable;
     this.esProperties = esProperties;
     this.esTable      = esTable;
     this.forecasted   = forecasted;
 }
        public Dtw getDTW(Template t, bool withTime = false)
        {
            var x    = new SeriesVariable(Series_X, t.Series_X, "X-Coord", new NDtw.Preprocessing.NormalizationPreprocessor());
            var y    = new SeriesVariable(Series_Y, t.Series_Y, "Y-Coord", new NDtw.Preprocessing.NormalizationPreprocessor());
            var time = new SeriesVariable(Series_Time, t.Series_Time, "Timestamp", new NDtw.Preprocessing.NormalizationPreprocessor());

            return((withTime) ?
                   new Dtw(new SeriesVariable[] { x, y, time }, DistanceMeasure.Euclidean) :
                   new Dtw(new SeriesVariable[] { x, y }, DistanceMeasure.Euclidean));
        }
Пример #22
0
        /// <summary>
        /// Mengeset variabel yang telah dipilih
        /// </summary>
        /// <param name="variable">SeriesVariable. variable</param>
        public void SetVariable(SeriesVariable variable)
        {
            this.variable = variable;

            this.maProperties.orde = 2;

            this.Text = "Moving Average : " + variable.VariableName;

            this.UpdateSettings();
        }
Пример #23
0
 public void SetData(SeriesData data, SeriesVariable variable,
                     MovingAverageForm.MASpecification maProperties,
                     MovingAverageForm.MAComponent maTable, double[] forecasted)
 {
     this.data         = data;
     this.variable     = variable;
     this.maProperties = maProperties;
     this.maTable      = maTable;
     this.forecasted   = forecasted;
 }
        /// <summary>
        /// Constructor. Menghitung Pemulusan Eksponensial Tripel
        /// </summary>
        /// <param name="variable">SeriesVariable. variabel</param>
        /// <param name="alpha">Double. Smoothing constant for data</param>
        /// <param name="gamma">Double. Smoothing constant for trend</param>
        /// <param name="beta">Double. Smoothing constant for seasonal</param>
        /// <param name="seasonalLength">Integer. Panjang seasonal</param>
        public TripleExponentialSmoothingWinter(SeriesVariable variable, double alpha, double gamma, double beta, int seasonalLength, bool isMultiplicative)
        {
            this.variable = variable;
            Vector var = new Vector(this.variable.SeriesValuesNoNaN.ToArray());

            this.y = new Vector(var.Tuples);
            for (int i = 0; i < y.Tuples; i++)
            {
                this.y[i] = var[i];
            }

            this.n     = this.y.Tuples;
            this.alpha = alpha;
            this.gamma = gamma;
            this.beta  = beta;
            this.l     = seasonalLength;

            this.isMultiplicative = isMultiplicative;

            this.smoothing = new double[this.n];
            this.trend     = new double[this.n];
            this.seasonal  = new double[this.n];
            this.predicted = new double[this.n];
            this.residual  = new double[this.n];

            //term
            term = new int[this.n];
            for (int i = 0; i < this.n;)
            {
                for (int j = 0; j < this.l; ++j)
                {
                    if (i + j != this.n)
                    {
                        term[i + j] = j;
                    }
                    else
                    {
                        break;
                    }
                }
                i += this.l;
            }

            if (this.isMultiplicative)
            {
                SmoothingMultiplicative();
            }
            else
            {
                SmoothingAdditive();
            }

            ForecastingError();
        }
        public void SetData(SeriesData data, SeriesVariable variable, bool isSmoothingVisible, double[] smoothed1, double[] predicted, double[] residual)
        {
            this.data               = data;
            this.variable           = variable;
            this.isSmoothingVisible = isSmoothingVisible;
            this.smoothed1          = smoothed1;
            this.predicted          = predicted;
            this.residual           = residual;

            this.update();
        }
 public void SetData(SeriesData data, SeriesVariable variable,
                     TrendAnalysisForm.TrendSpecification trendProperties,
                     double[] predicted, double[] forecasted, double[] residual)
 {
     this.data            = data;
     this.variable        = variable;
     this.trendProperties = trendProperties;
     this.predicted       = predicted;
     this.residual        = residual;
     this.forecasted      = forecasted;
 }
        /// <summary>
        /// Mengeset variabel yang telah dipilih
        /// </summary>
        /// <param name="variable">SeriesVariable. variable</param>
        public void SetVariable(SeriesVariable variable)
        {
            this.variable                      = variable;
            this.esProperties.alpha            = 0.2;
            this.esProperties.gamma            = 0.2;
            this.esProperties.beta             = 0.2;
            this.esProperties.seasonalLength   = 2;
            this.esProperties.isMultiplicative = true;
            this.Text = "Exponential Smoothing : " + variable.VariableName;

            this.UpdateSettings();
        }
        public void SetData(SeriesData data, SeriesVariable variable, bool isSmoothingVisible, bool isTrendVisible, bool isSeasonalVisible, double[] smoothing, double[] trend, double[] seasonal, double[] predicted, double[] residual)
        {
            this.data               = data;
            this.variable           = variable;
            this.isSmoothingVisible = isSmoothingVisible;
            this.isTrendVisible     = isTrendVisible;
            this.isSeasonalVisible  = isSeasonalVisible;
            this.smoothing          = smoothing;
            this.trend              = trend;
            this.seasonal           = seasonal;
            this.predicted          = predicted;
            this.residual           = residual;

            this.update();
        }
 public void SetData(SeriesData data,
                     SeriesVariable dependentVariable,
                     SeriesVariables independentVariables,
                     LinearRegressionAnalysisForm.LRSpecification lrProperties,
                     LinearRegressionAnalysisForm.LRComponent lrTable,
                     double[,] testValues,
                     string[] forcastedTime,
                     double[] forcastedData)
 {
     this.data = data;
     this.dependentVariable    = dependentVariable;
     this.independentVariables = independentVariables;
     this.lrProperties         = lrProperties;
     this.lrTable    = lrTable;
     this.testValues = testValues;
     this.time       = forcastedTime;
     this.forcasted  = forcastedData;
 }
Пример #30
0
        private void construct(SeriesVariable variable, double alpha)
        {
            this.variable = variable;
            Vector var = new Vector(this.variable.SeriesValuesNoNaN.ToArray());

            this.y = new Vector(var.Tuples);
            for (int i = 0; i < y.Tuples; i++)
            {
                this.y[i] = var[i];
            }

            this.n         = this.y.Tuples;
            this.a         = alpha;
            this.smoothing = new double[this.n];
            this.predicted = new double[this.n];
            this.residual  = new double[this.n];

            this.Smoothing();
            this.ForecastingError();
        }
Пример #31
0
    /// <summary>
    /// Starts the reading the buffer of the console output.
    /// </summary>
    /// <returns>An enumerator.</returns>
    IEnumerator StartConsole()
    {
        _buffer = new List<string>();
        while(!comparexe.HasExited)
        {
            yield return new WaitForSeconds(1);

            lock (_buffer)
            {
                while(_buffer.Count > 0)
                {
                    var line = _buffer[0];

                    if (string.IsNullOrEmpty(line))
                        { }
                    if (line.Contains("uid="))
                        UserID = ulong.Parse(line.Substring(4));
                    else if (line.Contains("act="))
                        ActionName = Properties.ActivityFromString(line.Substring(4).ToString());
                    else if (line.Contains("sfb="))
                        SemanticFeedback = line.Substring(4);
                    else if (line.Contains("tip="))
                        Tips = line.Substring(4).Split(new string[] { ":|:" }, System.StringSplitOptions.RemoveEmptyEntries);
                    else if (line.Contains("rel="))
                        AreRelated = bool.Parse(line.Substring(4));
                    else if (line.Contains("ovs="))
                        OverallScore = float.Parse(line.Substring(4), ni) * 100f;
                    else if (line.Contains("pss="))
                        PositionScore = float.Parse(line.Substring(4), ni) * 100f;
                    else if (line.Contains("rts="))
                        RotationScore = float.Parse(line.Substring(4), ni) * 100f;
                    else if (line.Contains("lvs="))
                        LinearVelocityScore = float.Parse(line.Substring(4), ni) * 100f;
                    else if (line.Contains("avs="))
                        AngularVelocityScore = float.Parse(line.Substring(4), ni) * 100f;
                    else if (line.Contains("plt="))
                    {
                        var pf = line.Substring(4).Split(new string[] { ":|:" }, System.StringSplitOptions.RemoveEmptyEntries);
                        PlotFiles = pf.Where((str, i) => i % 2 == 1).ToArray();
                        AvailablePlots = pf.Where ((str, i) => i % 2 == 0).ToArray();
                    }
                    else if (line.Contains("tjs="))
                    {
                        var ts = line.Substring(4).Split(new string[] { ":|:" }, System.StringSplitOptions.RemoveEmptyEntries);
                        Trajectories = new SeriesVariable<Vec3f>[ts.Length];
                        for (int i = 0; i < ts.Length; i++)
                            Trajectories[i] = SeriesVariable<Vec3f>.FromString(ts[i]);
                    }
                    else if (line.Contains("Start"))
                    {
                        CurrentState = State.START;
                        DoneComparison = false;
                        _is_comparing = true;
                        _start_time = UnityEngine.Time.time;
                        Debug.Log("Compare started.");
                    }
                    else if (line.Contains("Compare done!"))
                    {
                        Debug.Log(string.Format("Compare done! Elapsed time: {0}", Time));
                        CurrentState = State.DRAW_PLOTS;
                        _is_comparing = false;
                        _start_time = -1;
                        DoneComparison = true;
                    }
                    else if (line.Contains("Done!"))
                    {
                        if (!AreRelated)
                        {
                            var tip_1 = Tips[0];

                            Tips = new string[] { tip_1 };
                        }

                        CurrentState = State.DONE;
                        yield break;
                    }
                    else if (line.Contains(":|:"))
                    {
                        var plots = new List<string>();
                        plots.AddRange (PlotFiles);
                        plots.AddRange (line.Substring(4).Split(new string[] { ":|:" }, System.StringSplitOptions.RemoveEmptyEntries));
                        PlotFiles = plots.ToArray();
                    }
                    else
                        Debug.Log(line);

                    _buffer.RemoveAt(0);
                }
            }
        }
        yield break;
    }