//method which plots the acf and pacf for the data
        public void HookUpData()
        {
            System.Windows.Forms.Cursor old = this.Cursor;
            this.Cursor = Cursors.AppStarting;

            this.show();
            this.hidesubset();

            //if you pick an alternative tab, then you want the ACF and PACF for the previously differenced data set to be hidden
            ARIMAac2.Hide();

            this.P = new Statistics(Tseries);

            //calculate the autcorrelation and partial autocorrelation of the data
            List<double> sac = P.sampleautocorrelation(P.D, 50);
            sac.RemoveAt(0);
            List<double> spac = P.samplepartialautocorrelation(P.D, 50);
            spac.RemoveAt(0);

            //we will use the following code to create the horizontal lines in the ACF and PACF plots
            int n = this.P.D.Count();
            double l1 = 1.96 / Math.Sqrt(n);
            double l2 = -1.96 / Math.Sqrt(n);
            List<double> line1 = new List<double>();
            List<double> line2 = new List<double>();
            for (int i = 0; i < sac.Count(); i++)
            {
                line1.Add(l1);
                line2.Add(l2);
            }
            //plot of the sample acf and pacf
            ARIMAac1.Titles.Clear();
            ARIMAac1.Titles.Add(new Title("Sample ACF and PACF", Docking.Top, new Font("Verdana", 8f, FontStyle.Bold), Color.Black));
            ARIMAac1.ChartAreas[0].AxisY.LabelStyle.Font = ARIMAac1.ChartAreas[0].AxisX.LabelStyle.Font = new Font("Arial", 11, GraphicsUnit.Pixel);
            ARIMAac1.ChartAreas[0].RecalculateAxesScale();
            ARIMAac1.Series.Clear();
            var series1 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name = "ACF",
                Color = System.Drawing.Color.Blue,
                IsVisibleInLegend = true,
                IsXValueIndexed = true,
                ChartType = SeriesChartType.Column
            };
            this.ARIMAac1.Series.Add(series1);
            int z = 0;
            foreach (double dd in sac)
            {
                series1.Points.AddXY(z + 1, sac[z]);
                z++;
            }
            var series2 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name = "PACF",
                Color = System.Drawing.Color.Red,
                IsVisibleInLegend = true,
                IsXValueIndexed = true,
                ChartType = SeriesChartType.Column
            };
            this.ARIMAac1.Series.Add(series2);
            z = 0;
            foreach (double dd in spac)
            {
                series2.Points.AddXY(z + 1, spac[z]);
                z++;
            }

            var series21 = new System.Windows.Forms.DataVisualization.Charting.Series
               {
               Name = "Series21",
               Color = System.Drawing.Color.Black,
               IsVisibleInLegend = false,
               IsXValueIndexed = true,
               ChartType = SeriesChartType.Line
               };
            this.ARIMAac1.Series.Add(series21);
            z = 0;
            foreach (double dd in line1)
            {
                series21.Points.AddXY(z + 1, line1[z]);
                z++;
            }

            var series22 = new System.Windows.Forms.DataVisualization.Charting.Series
            {
                Name = "Series22",
                Color = System.Drawing.Color.Black,
                IsVisibleInLegend = false,
                IsXValueIndexed = true,
                ChartType = SeriesChartType.Line
            };
            this.ARIMAac1.Series.Add(series22);
            z = 0;
            foreach (double dd in line2)
            {
                series22.Points.AddXY(z + 1, line2[z]);
                z++;
            }
            ARIMAac1.Invalidate();
            ARIMAac1.ChartAreas[0].AxisY.Maximum = Math.Max(P.maximum(sac), P.maximum(spac));

            this.Cursor = old;
        }