资源简介
WindowsFormsApplication1.rar

代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using MathNet.Numerics;
using MathNet.Numerics.LinearAlgebra.Double;
using MathNet.Numerics.Distributions;
namespace WindowsFormsApplication1
{
public class DiscreteMarkov
{
#region 属性
///
/// 样本点状态时间序列按照时间升序
///
public List StateList { get; set; }
///
/// 状态总数对应模型的m
///
public int Count { get; set; }
///
/// 概率转移矩阵Pij
///
public List ProbMatrix { get; set; }
///
/// 各阶的自相关系数
///
public double[] Rk { get; set; }
///
/// 各阶的权重
///
public double[] Wk { get; set; }
///
/// 频数矩阵
///
public int[][] CountStatic { get; set; }
///
/// 目标序列是否满足“马氏性“
///
public Boolean IsMarkov { get; set; }
///
/// 滞时期,K
///
public int LagPeriod { get; set; }
///
/// 预测概率
///
public double[] PredictValue { get; set; }
#endregion
#region 构造函数
public DiscreteMarkov(List data int count int K = 5)
{
this.StateList = data;
this.LagPeriod = K;
this.Count = count;
this.CountStatic = StaticCount(data count);
this.ProbMatrix = new List();
var t0 = DenseMatrix.OfArray(StaticProbability(this.CountStatic));
ProbMatrix.Add(t0);
for (int i = 1; i < K; i++) //根据CK方程,计算各步的状态转移矩阵
{
var temp = ProbMatrix[i - 1] * t0;
ProbMatrix.Add(temp);
}
IsMarkov = ValidateMarkov();
if (IsMarkov)
{
CorrCoefficient();
TimeWeight();
PredictProb();
}
else
{
Console.WriteLine(“马氏性 检验失败无法进行下一步预测“);
}
}
#endregion
#region 验证
///
/// 验证是否满足马氏性默认的显著性水平是0.05,自由度25
///
///
private Boolean ValidateMarkov()
{
//计算列和
int[] cp1 = new int[Count];
double gm = 0;
try
{
int allcount = CountStatic.Select(n => n.Sum()).Sum();//总数
for (int i = 0; i < Count; i++)
{
for (int j = 0; j < Count; j++) cp1[i] += CountStatic[j][i];
}
double[] cp = cp1.Select(n => (double)n / (double)allcoun
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1041 2016-01-04 14:35 WindowsFormsApplication1\WindowsFormsApplication1.sln
..A..H. 46592 2017-06-25 13:07 WindowsFormsApplication1\WindowsFormsApplication1.v12.suo
文件 7664 2016-01-05 16:07 WindowsFormsApplication1\WindowsFormsApplication1\DiscreteMarkov.cs
文件 505 2016-01-04 14:35 WindowsFormsApplication1\WindowsFormsApplication1\Program.cs
文件 4446 2016-01-04 15:09 WindowsFormsApplication1\WindowsFormsApplication1\WindowsFormsApplication1.csproj
文件 1121752 2013-07-23 05:17 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\FSharp.Core.dll
文件 603029 2013-07-23 05:17 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\FSharp.Core.xm
文件 1177600 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.dll
文件 455680 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.FSharp.dll
文件 294400 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.FSharp.pdb
文件 90418 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.FSharp.xm
文件 3792384 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.pdb
文件 3229256 2015-12-30 17:23 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\MathNet.Numerics.xm
文件 19968 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
文件 50688 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
文件 22656 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
文件 490 2017-03-19 05:00 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
文件 36352 2013-09-24 22:54 WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\zh-Hans\FSharp.Core.resources.dll
文件 1453 2016-01-05 16:22 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 7214 2017-06-25 13:03 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 6555 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
文件 19968 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.exe
文件 180 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Form1.resources
文件 50688 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.pdb
文件 180 2016-01-04 15:24 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.Properties.Resources.resources
文件 48789 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
文件 977 2017-06-25 13:06 WindowsFormsApplication1\WindowsFormsApplication1\obj\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
文件 1390 2016-01-04 14:35 WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs
文件 2900 2016-01-04 14:35 WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs
文件 5612 2016-01-04 14:35 WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.resx
............此处省略17个文件信息
相关资源
- PID_AutoTune_v0.rar
- vspd7.2.308.zip
- 价值2k的H漫画小说系统
- Pythonamp;课堂amp;笔记(高淇amp;400;集第
- ddos压力测试工具99657
- UML建模大全
- 开源1A锂电池充电板TP4056原理图+PCB
- m1卡 ic卡可选择扇区初始化加密软件
- TSCC.exe
- FTP课程设计(服务端+客户端)
- 计算机图形学 边填充算法实现代码
- 电力系统潮流计算程序集合
- oracle数据迁移项目实施方案
- Web Api 通过文件流 文件到本地
- Visio图标-最新最全的网络通信图标库
- Spire API文档
- OpenGL参考手册
- Python中Numpy库最新教程
- SPD博士V5.3.exe
- 直流无刷电机方波驱动 stm32 例程代码
- layui后台管理模板
- 仿知乎界面小程序源代码
- 云平台-阿里云详细介绍
- photoshop经典1000例
- scratch垃圾分类源码(最终版本).sb
- IAR ARM 7.8破解
- TI CCS V5.4 安装步骤及破解文件
- 松下plc FP-XH的驱动
- 局域网硬件信息收集工具
- 加快Windows XP操作系统开机速度
评论
共有 条评论