【问题标题】:im using python to work out the johansen test for my project but it is not showing result? [closed]我正在使用 python 为我的项目进行 johansen 测试,但它没有显示结果? [关闭]
【发布时间】:2021-04-24 08:54:40
【问题描述】:

这是我写的代码:

from statsmodels.tsa.vector_ar.vecm import coint_johansen       
import numpy as np'       
x= pd.DataFrame(data['ln_bit'])       
y= pd.DataFrame(data['ln_nas'])        
df = pd.concat([x,y], axis=1)        
coint_johansen (df, 0, 1)    

输出是这样的:

有什么帮助吗?它没有显示实际结果

【问题讨论】:

    标签: python pandas anaconda


    【解决方案1】:

    coint_johansen返回一个对象JohansenTestResult你可以找到更多细节here

    前-

    import datetime
    
    import pandas as pd
    import numpy as np
    
    from statsmodels.tsa.vector_ar.vecm import coint_johansen 
    
    
    test_result = coint_johansen(y, 0, p)
    
    test_result.max_eig_stat
    array([200.21744043, 167.84190294, 1.76746927])
    
    test_result.trace_stat_crit_vals
    array([[27.0669, 29.7961, 35.4628],
           [13.4294, 15.4943, 19.9349],
           [2.7055, 3.8415, 6.6349]])
    
    test_result.max_eig_stat
    array([200.21744043, 167.84190294, 1.76746927])
    
    test_result.max_eig_stat_crit_vals
    array([[18.8928, 21.1314, 25.865],
           [12.2971, 14.2639, 18.52],
           [2.7055, 3.8415, 6.6349]])
    

    【讨论】:

    • 我将如何解释这些值?
    • 只需将其转换为list 并使用like - list(test_result.max_eig_stat)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多