【问题标题】:How to plot cross-correlation function in python jupyter notebook如何在 python jupyter notebook 中绘制互相关函数
【发布时间】:2018-02-16 07:49:15
【问题描述】:

我正在尝试按照http://www.michaeljgrogan.com/cross-correlation-r/ 中的描述绘制样本互相关函数

但是,我不想使用 R 中的函数或使用 rpy2 库。我想知道 Python 中的某个库中是否已经有一个内置函数,比如sm.tsa.stattools。嵌入在 Jupyter 笔记本中的东西。

另外,我在哪里可以找到用于 VAR 模型的 python 内置库以及在 python 中估计 VAR 或 Structural VAR 模型?

非常感谢

【问题讨论】:

    标签: python-3.x statistics jupyter-notebook


    【解决方案1】:

    虽然,我对这个解决方案不太满意,因为没有虚线

    不过这样就可以了

    import matplotlib.pyplot as plt
    plt.xcorr(df.ix[:,2],df.ix[:,3],maxlags=15, usevlines=1)
    plt.show()
    

    但我想知道是否有更好的数字

    【讨论】:

      猜你喜欢
      • 2022-08-18
      • 2016-11-16
      • 2019-11-14
      • 2016-10-10
      • 2018-11-18
      • 1970-01-01
      • 2019-03-22
      • 2018-11-15
      • 1970-01-01
      相关资源
      最近更新 更多