本文整理汇总了C#中Statistics.samplepartialautocorrelation方法的典型用法代码示例。如果您正苦于以下问题:C# Statistics.samplepartialautocorrelation方法的具体用法?C# Statistics.samplepartialautocorrelation怎么用?C# Statistics.samplepartialautocorrelation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Statistics
的用法示例。
在下文中一共展示了Statistics.samplepartialautocorrelation方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HookUpData
//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();
//.........这里部分代码省略.........