test_montecarlo.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:pyrisk 作者: nasseralkmim 项目源码 文件源码
def test_mc_normal():
    """kstest returns:

              1. KS statistic
              2. pvalue

    if pvalue > 0.05 (5%) we accept the null hypothesis:

    H0: our random variable from simulation follow the distribution with
        the parameters obtained from 'stats.dist.fit'.             

    """
    x = montecarlo.normal(1000, 0, 1)
    ks = stats.kstest(x, 'norm', stats.norm.fit(x))
    assert ks[1] > .05
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号