[R-sig-finance] VAR, VECM, Kalman, ... non-R software recommendations?

Jeffrey Todd Lins jtl at saxobank.com
Sat Aug 21 00:25:02 CEST 2004

That reminds me, Dirk.

Brandon Whitcher, who wrote the waveslim package, co-authored a book on filters (mostly on wavelets) with Gencay and Selcuk.  They used an example of a structural TS model for time-varying betas I think, in their chapter on the Kalman. 

Anyway, maybe Brandon Whitcher has made some R code too.


-----Original Message-----
From: r-sig-finance-bounces at stat.math.ethz.ch
[mailto:r-sig-finance-bounces at stat.math.ethz.ch]On Behalf Of krishna
Sent: Saturday, August 21, 2004 2:36 AM
To: R-sig-finance at stat.math.ethz.ch
Subject: Re: [R-sig-finance] VAR, VECM, Kalman,... non-R software

I have mucked around with the kalman for estimating time-varying betas. 
there was another interest
in cointegration stuff a few weeks back.

I will clean up my code, and put it up someplace.

One suggestion i have for R-SIGGERS is to have a place to post code like
a repository.
Someplace like the elseiver computer physics code repository

for which you have to cough up $$$.  The R-SIG repository should be free.

The idea is already in place for some econometric journals where you
have people uploading their data-sets and routines.
It would be nice to have a facility where one can upload the code with a
little blurb of what the routines are doing.

any ideas.??.  I am sure there is a opensource thingie that accepts code
and a little document and that allows users to rate/leave comments?

If anyone knows one let me know. We are going to see more and more of  
"How do I do foo goo in R ?"    or
"I  know we can do boomoo in math$  but can you do it in R ?"

Just my 2 cents.

Jeffrey Todd Lins wrote:

>Hi Dirk,
>Yes, in stats there is a set of Kalman filter routines and you can use optim for likelihood estimation.
>I have used it for some state space modeling. There is a chapter in Zivot and Wang's book on the topic as well.
>In addition initializing in the KF may be an important consideration - see Harvey and/or Durbin and Koopman.
>I have never really used DSE for VAR, ended up writing the code elsewhere, outside of R, but you could look at gretl,
>which is available under GNU GPL and written in C, it contains quite a few bits and pieces, I am assuming you can get the source.
>-----Original Message-----
>From: r-sig-finance-bounces at stat.math.ethz.ch
>[mailto:r-sig-finance-bounces at stat.math.ethz.ch]On Behalf Of Pijus
>Sent: Friday, August 20, 2004 7:37 PM
>To: Dirk Eddelbuettel
>Cc: R-sig-finance at stat.math.ethz.ch
>Subject: RE: [R-sig-finance] VAR, VECM, Kalman,... non-R software
>Dear Dirk,
>As far as my personal experience goes, I needed to estimate such models
>some time ago, when the R toolkit for this sort of thing was still
>almost empty, so I chose to invest in STATA: it provides a fairly
>complete set of functions to estimate VAR, SVAR and (as of two months
>ago) VECM models, validate their results and stability, and calculate
>all the frequently-needed derivatives, such as the MA forms (i.e. IRFs,
>SIRFs, ...), etc. For what it's worth, I chose STATA over many other
>contenders in the field because it seemed to have some of those R-like
>pro-active qualities, like frequent updates, knowledgeable and involved
>users, and accessible developers (to which I can personally attest after
>running into a couple of bugs in the early SVAR code). The R-STATA
>intercommunication is made possible by the foreign package, batch modes,
>and good old ASCII. ;) STATA programming is a bit laborious, so I always
>only farm out the absolute minimum to it, and do the remainder in R. As
>you said, STATA let me "hit the ground running", and is really not a bad
>Of course, today R's own arsenal for time-series econometrics is shaping
>up fast as well. Most significantly, there is now the CRAN urca package
>by Bernhard Pfaff: it provides the means to estimate VECM models (both
>the transitory and long-term flavours) and Johansen's co-integration
>tests built on top them. Sadly, VAR/SVAR and associated battery of
>helper functions are still not available, as far as I am aware.
>As for the Kalman filter, there is the Kalman... family of functions in
>stats: perhaps that's a good place to start? Sadly, I have not yet had a
>chance to use space-state models in a proper project, so my knowledge of
>the available tools and their relative capabilities is modest. Also, if
>you can get to it, R. Carmona's neat book "Statistical Analysis of
>Financial Series in S-Plus" (Springer, 2004) has a few sections
>(6.2-6.7) on state-space models and Kalman filtering thereof (S code
>included), with applications to finance.
>>-----Original Message-----
>>From: r-sig-finance-bounces at stat.math.ethz.ch
>>[mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of
>>Dirk Eddelbuettel
>>Sent: Friday, August 20, 2004 12:49 PM
>>To: R-sig-finance at stat.math.ethz.ch
>>Subject: [R-sig-finance] VAR, VECM, Kalman,... non-R software
>>I've been asked to run some 'modern' regressions: vector
>>vector error correction, kalman filter, ...
>>Of course, I'd love to do that in R and will probably end up
>>writing some
>>code for it, but as the platitude goes, I 'need to hit the
>>ground running'.
>>Last time I looked at Paul Gilbert's dse bundle, it promised
>>most of this,
>>but felt somewhat cumbersome.
>>Does anybody here have any particular recommendations, and in
>>warnings about software like EViews, Rats, ... in this context ?
>>Thanks in advance,  Dirk
>>Those are my principles, and if you don't like them... well,
>>I have others.

R-sig-finance at stat.math.ethz.ch mailing list

This email may contain confidential and/or privileged inform...{{dropped}}

More information about the R-sig-finance mailing list