文章 "MQL5 中的统计分布 - 取最佳的 R" - 页 18 1...11121314151617181920 新评论 Quantum 2017.11.06 19:05 #171 Alexey Nikolaev:您好,,在 R 中计算伽马分布的量值时遇到了一个问题:> qgamma(0.05,2,scale=1)[1] 0.3553615> qgamma(0.05,10,scale=1)[1] 5.425406,在 mql5 中:结果: 0.3553615106986621 错误 4 build 1596更改了伽玛分布的量化计算。修正了附录中的 Gamma.mqh 版本(在 MQL5\Include\Math\Stat\ 中替换)。计算结果:2017.11.06 21:03:56.580 TestExample (USDJPY,M5) 0.3553615106986623 2017.11.06 21:03:56.580 TestExample (USDJPY,M5) 5.425405697091294 附加的文件: Gamma.mqh 32 kb Aleksey Nikolayev 2019.05.07 22:18 #172 帮助页面 上写的是 MathProbabilityDensityGamma() 而不是 MathProbabilityDensityNoncentralBeta() Rashid Umarov 2019.05.08 12:03 #173 Aleksey Nikolayev: 帮助页面 上写的是 MathProbabilityDensityGamma() 而不是 MathProbabilityDensityNoncentralBeta()谢谢,已更正 Aleksey Nikolayev 2019.09.23 08:39 #174 MathCumulativeDistributionHypergeometric() 函数错误地计算了超几何分布的 CDF。根据定义,概率分布 函数必须为任何实数定义。下面是 mql5 上的脚本及其结果,为了便于比较,还提供了 R 上的相同结果。 #include <Math\Stat\Hypergeometric.mqh> input int nall=9; // 所有 input int nsc=2; // 全部成功 input int nsm=8; // 样本数量 void OnStart() { int er; double k[]={-1,0,0.5,1}; for(int i=0; i<4; ++i) Print((string)k[i]+" "+(string)MathCumulativeDistributionHypergeometric(k[i],nall,nsc,nsm,er)+" "+(string)er); } 结果 -1.0 nan 2 0.0 0.0 0 0.5 纳 2 在'Hypergeometric.mqh'(241,35)中除以零 nall <- 9 # all nsc <- 2 # all success nsm <- 8 # sample size k <- c(-1, 0, 0.5, 1) phyper(k, nsc, nall-nsc, nsm) 结果: [1] 0.0000000 0.0000000 0.0000000 0.2222222 Quantum 2019.09.23 10:00 #175 Aleksey Nikolayev:MathCumulativeDistributionHypergeometric() 错误地计算了超几何分布的 CDF。 感谢您的留言,我们将对此进行研究。 Aleksey Nikolayev 2019.09.24 06:34 #176 我们希望将Kolmogorov 分布 加入库中。该分布非常有用,因为它可用于柯尔莫哥洛夫-斯米尔诺夫准则和搜索随机过程的不和谐问题。 Aleksey Nikolayev 2019.10.06 07:41 #177 如果我没有弄错的话,MathQuickSort*() 快速排序功能不会填充 原始数组的索引数组: #include <Math\Stat\Math.mqh> void OnStart() { double a[]={1.5, 2.0, -1.0, 0.0}; int na=ArraySize(a); int ix[]; ArrayResize(ix,na); for(int i=0; i<na; ++i) ix[i]=0; //MathQuickSort(a,ix,1,2,1); //MathQuickSort(a,ix,1,2,-1); MathQuickSortAscending(a,ix,1,2); /MathQuickSortDescending(a,ix,1,2); for(int i=0; i<na; ++i) Print((string)ix[i]+" "+(string)a[i]); } 结果 0 1.5 0 -1.0 0 2.0 0 0.0 Quantum 2019.10.07 10:05 #178 Aleksey Nikolayev:除非我弄混了,否则 MathQuickSort*() 快速排序功能不会填充 原始数组的索引数组:在我们的实现中,索引数组本身并不填充,索引值必须在调用排序之前自己准备好: for(int i=0; i<na; ++i) ix[i]=i; 或 for(int i=0; i<na; ++i) ix[i]=i+1; 或如果需要自然顺序。 Aleksey Nikolayev 2019.10.10 09:42 #179 Setslav>>>隐藏产品是为了引起您的注意。 另外,我找不到在市场上发布新产品的按钮。是每个人都这样,还是只有我这样?如何发布 MT5 版本? 如果产品被版主隐藏,作者就无法返回。这符合逻辑 Aleksey Nikolayev 2019.10.19 10:11 #180 例如,有些(并非所有)二项式 系数是负数: #include <Math\Stat\Math.mqh> void OnStart() { Print(MathBinomialCoefficient(62,28)); } 结果: -309196571788882235 应为:349615716557887488 1...11121314151617181920 新评论 您错过了交易机会: 免费交易应用程序 8,000+信号可供复制 探索金融市场的经济新闻 注册 登录 拉丁字符(不带空格) 密码将被发送至该邮箱 发生错误 使用 Google 登录 您同意网站政策和使用条款 如果您没有帐号,请注册 可以使用cookies登录MQL5.com网站。 请在您的浏览器中启用必要的设置,否则您将无法登录。 忘记您的登录名/密码? 使用 Google 登录
您好,
,在 R 中计算伽马分布的量值时遇到了一个问题
:
> qgamma(0.05,2,scale=1)
[1] 0.3553615
> qgamma(0.05,10,scale=1)
[1] 5.425406
,在 mql5 中:
结果:
0.3553615106986621
错误 4
build 1596
更改了伽玛分布的量化计算。修正了附录中的 Gamma.mqh 版本(在 MQL5\Include\Math\Stat\ 中替换)。
计算结果:
帮助页面 上写的是 MathProbabilityDensityGamma() 而不是 MathProbabilityDensityNoncentralBeta()
谢谢,已更正
MathCumulativeDistributionHypergeometric() 函数错误地计算了超几何分布的 CDF。根据定义,概率分布 函数必须为任何实数定义。下面是 mql5 上的脚本及其结果,为了便于比较,还提供了 R 上的相同结果。
结果
-1.0 nan 2
0.0 0.0 0
0.5 纳 2
在'Hypergeometric.mqh'(241,35)中除以零
结果:
[1] 0.0000000 0.0000000 0.0000000 0.2222222
MathCumulativeDistributionHypergeometric() 错误地计算了超几何分布的 CDF。
感谢您的留言,我们将对此进行研究。
如果我没有弄错的话,MathQuickSort*() 快速排序功能不会填充 原始数组的索引数组:
结果
0 1.5
0 -1.0
0 2.0
0 0.0
除非我弄混了,否则 MathQuickSort*() 快速排序功能不会填充 原始数组的索引数组:
在我们的实现中,索引数组本身并不填充,索引值必须在调用排序之前自己准备好:
或
或如果需要自然顺序。Setslav
>>>隐藏产品是为了引起您的注意。
另外,我找不到在市场上发布新产品的按钮。是每个人都这样,还是只有我这样?如何发布 MT5 版本?
如果产品被版主隐藏,作者就无法返回。这符合逻辑
例如,有些(并非所有)二项式 系数是负数:
结果: -309196571788882235
应为:349615716557887488