Skip to content

BUG VAR fit with trend='t' raises exception #2271

Closed

Description

@josef-pkt

with example from tutorial

model_t = VAR(data_t)
results = model.fit(4, trend = 't')

---------------------------------------------------------------------------
UnboundLocalError                         Traceback (most recent call last)
<ipython-input-98-f7328095d596> in <module>()
      1 model_t = VAR(data_t)
----> 2 results = model.fit(4, trend = 't')

e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\tsa\vector_ar\var_model.py in fit(self, maxlags, method, ic, trend, verbose)
    429                 lags = 1
    430 
--> 431         k_trend = util.get_trendorder(trend)
    432         self.exog_names = util.make_lag_names(self.endog_names, lags, k_trend)
    433         self.nobs = len(self.endog) - lags

e:\josef\eclipsegworkspace\statsmodels-git\statsmodels-all-new2_py27\statsmodels\statsmodels\tsa\vector_ar\util.pyc in get_trendorder(trend)
     45     elif trend == 'ctt':
     46         trendorder = 3
---> 47     return trendorder
     48 
     49 def make_lag_names(names, lag_order, trendorder=1):

UnboundLocalError: local variable 'trendorder' referenced before assignment

Activity

  1. added this to the 0.8 milestone on Feb 16, 2015
  2. added 2 commits that reference this issue on Mar 18, 2015
    a19d847
    ea87486
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions