Python 使用';导入时出错;沙米尔顿过滤日志';从';statsmodels.tsa.Region_switching._hamilton_filter';
我试图在python中从statsmodels()编译MarkovSwitching.py,但出现了以下错误:Python 使用';导入时出错;沙米尔顿过滤日志';从';statsmodels.tsa.Region_switching._hamilton_filter';,python,python-3.x,statsmodels,markov-models,Python,Python 3.x,Statsmodels,Markov Models,我试图在python中从statsmodels()编译MarkovSwitching.py,但出现了以下错误: ImportError: cannot import name 'shamilton_filter_log' from 'statsmodels.tsa.regime_switching._hamilton_filter' (C:\Users\myuser\Anaconda3\lib\site-packages\statsmodels\tsa\regime_switching\_ha
ImportError: cannot import name 'shamilton_filter_log' from 'statsmodels.tsa.regime_switching._hamilton_filter' (C:\Users\myuser\Anaconda3\lib\site-packages\statsmodels\tsa\regime_switching\_hamilton_filter.cp37-win_amd64.pyd)
我不知道如何解决这个问题。此外,我使用“”pip install statsmodels--upgrade“”升级statsmodels,但不起作用
我不知道如何解决这个问题,欢迎任何帮助
谢谢 很难从您的描述中判断出可能出了什么问题,因为您的设置可能存在很多问题 看起来您可能已经通过Conda或pip安装了Statsmodels v0.10,然后下载了
markov_switching.py
的开发版本。开发版本有v0.10所没有的新功能,这是我对为什么会出现错误的猜测
您可以尝试安装v0.11的候选版本,使用:
pip install statsmodels==0.11.0rc1
非常感谢您的回答!我使用python的时间很短,但是Statsmodels对我帮助很大。我正在做一些马尔可夫切换任务,特别是确定“它作为输入输入输入”在线类马尔可夫切换(tsbase.TimeSeriesModel)和def平滑;在这两种情况下,确定输出是什么。这就是我试图编译markov_switching.py的原因,但是我遇到了导入错误“shamilton_filter_log”。