当前位置: 首页>>代码示例>>C#>>正文


C# Statistics.maximum方法代码示例

本文整理汇总了C#中Statistics.maximum方法的典型用法代码示例。如果您正苦于以下问题:C# Statistics.maximum方法的具体用法?C# Statistics.maximum怎么用?C# Statistics.maximum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Statistics的用法示例。


在下文中一共展示了Statistics.maximum方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HookUpData


//.........这里部分代码省略.........
            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;
        }
开发者ID:josephanthonycollins,项目名称:WindApp2015,代码行数:101,代码来源:ARIMA.cs


注:本文中的Statistics.maximum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。