Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Statsmodels version 0.6.1 does not include tsa?

I'm trying to get the HP-filter working using statsmodels (sm).

The documentation here implies that the module sm.tsa already exists for 0.6.1, but I get the following error:

>>> import statsmodels as sm
>>> sm.__version__
'0.6.1'
>>> sm.tsa.filters.hp_filter.hpfilter()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'tsa'
>>> sm.tsa
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: 'module' object has no attribute 'tsa'

Here's my pip output:

nat-oitwireless-inside-vapornet100-a-14423:prog2 foobar$ pip show statsmodels
---
Name: statsmodels
Version: 0.6.1
Location: /usr/local/lib/python2.7/site-packages/statsmodels-0.6.1-py2.7-macosx-10.9-x86_64.egg
Requires: 
like image 726
FooBar Avatar asked Dec 05 '14 22:12

FooBar


People also ask

Is statsmodels a package?

statsmodels is a Python package that provides a complement to scipy for statistical computations including descriptive statistics and estimation and inference for statistical models.

What does import statsmodels API as SM do?

Importing statsmodels. api will load most of the public parts of statsmodels. This makes most functions and classes conveniently available within one or two levels, without making the “sm” namespace too crowded.


1 Answers

You need to import statsmodels.api as sm

like image 120
jseabold Avatar answered Sep 18 '22 15:09

jseabold