Skip to content

Commit

Permalink
MVDLM work. and i broke regular DLM somehow...
Browse files Browse the repository at this point in the history
  • Loading branch information
wesm committed Mar 22, 2011
1 parent 65e6439 commit 9df8771
Show file tree
Hide file tree
Showing 2 changed files with 184 additions and 107 deletions.
22 changes: 20 additions & 2 deletions statlib/components.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Components for specifying dynamic linear models
Components for specifying dynamic linear (state space) models
Notes
-----
Expand Down Expand Up @@ -46,7 +46,25 @@ def __init__(self, F, discount=None):
F = np.atleast_2d(F).T

G = np.eye(F.shape[1])
Component.__init__(self, F, G, discount=discount)

super(Regression, self).__init__(F, G, discount=discount)

class AR(Component):
pass

class VectorAR(Component):

def __init__(self, X, lags=1, intercept=True, discount=None):
nobs = len(X) - lags

X = np.asarray(X)
F = np.concatenate([X[lags - i:-i] for i in range(1, lags + 1)], axis=1)
G = None

if intercept:
F = np.c_[np.ones((nobs, 1)), F]

super(VectorAR, self).__init__(F, G, discount=discount)

class ARMA(Component):
"""
Expand Down
Loading

0 comments on commit 9df8771

Please sign in to comment.