[SciPy-User] modeling GARCH process

92 views
Skip to first unread message

John Hunter

unread,
Dec 29, 2009, 1:47:30 PM12/29/09
to SciPy Users List
I would like to model a time series as a GARCH process (estimate the
parameters of a model and then generate random samples with these
parameters). There are numerous ways to do this in R, but I prefer
python if possible. I notice that Enthought teaches this in their
Finance for Quants lectures. Does anyone have some example code for
modeling and simulating GARCH processes in python?

Thanks,
JDH
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user

josef...@gmail.com

unread,
Dec 29, 2009, 2:34:37 PM12/29/09
to SciPy Users List
On Tue, Dec 29, 2009 at 1:47 PM, John Hunter <jdh...@gmail.com> wrote:
> I would like to model a time series as a GARCH process (estimate the
> parameters of a model and then generate random samples with these
> parameters).  There are numerous ways to do this in R, but I prefer
> python if possible.  I notice that Enthought teaches this in their
> Finance for Quants lectures.  Does anyone have some example code for
> modeling and simulating GARCH processes in python?

I would also like to know, I haven't seen any python GARCH so far.

I started to translate http://www.kevinsheppard.com/wiki/MFE_Toolbox
(BSD license) into python, but it is slow going and I'm running out of
Christmas break. The plan is to have a tested literal translation and
then to numpify/scipify it.

ETA: half a year.

Josef

John Hunter

unread,
Dec 29, 2009, 2:55:11 PM12/29/09
to SciPy Users List
On Tue, Dec 29, 2009 at 1:34 PM, <josef...@gmail.com> wrote:
> On Tue, Dec 29, 2009 at 1:47 PM, John Hunter <jdh...@gmail.com> wrote:
>> I would like to model a time series as a GARCH process (estimate the
>> parameters of a model and then generate random samples with these
>> parameters).  There are numerous ways to do this in R, but I prefer
>> python if possible.  I notice that Enthought teaches this in their
>> Finance for Quants lectures.  Does anyone have some example code for
>> modeling and simulating GARCH processes in python?
>
> I would also like to know, I haven't seen any python GARCH so far.
>
> I started to translate http://www.kevinsheppard.com/wiki/MFE_Toolbox
> (BSD license) into python, but it is slow going and I'm running out of
> Christmas break. The plan is to have a tested literal translation and
> then to numpify/scipify it.
>
> ETA: half a year.

Wow, that would be fantastic, but I don't envy you :-) That looks
like quite a task.

This would be a great google summer of code project if you can get it
far enough along that a dedicated student or two could finish, polish,
document and test.

Skipper Seabold

unread,
Dec 29, 2009, 3:04:10 PM12/29/09
to SciPy Users List
On Tue, Dec 29, 2009 at 2:55 PM, John Hunter <jdh...@gmail.com> wrote:
> On Tue, Dec 29, 2009 at 1:34 PM,  <josef...@gmail.com> wrote:
>> On Tue, Dec 29, 2009 at 1:47 PM, John Hunter <jdh...@gmail.com> wrote:
>>> I would like to model a time series as a GARCH process (estimate the
>>> parameters of a model and then generate random samples with these
>>> parameters).  There are numerous ways to do this in R, but I prefer
>>> python if possible.  I notice that Enthought teaches this in their
>>> Finance for Quants lectures.  Does anyone have some example code for
>>> modeling and simulating GARCH processes in python?
>>
>> I would also like to know, I haven't seen any python GARCH so far.
>>
>> I started to translate http://www.kevinsheppard.com/wiki/MFE_Toolbox
>> (BSD license) into python, but it is slow going and I'm running out of
>> Christmas break. The plan is to have a tested literal translation and
>> then to numpify/scipify it.
>>
>> ETA: half a year.
>

Maybe faster for at least a rough pass, if you get some help with the
time series stuff ;)

> Wow, that would be fantastic, but I don't envy you :-)  That looks
> like quite a task.

I'll also be helping out with this most likely in the coming months,
as it looks like I'll be doing time series specific coursework.

>
> This would be a great google summer of code project if you can get it
> far enough along that a dedicated student or two could finish, polish,
> document and test.
>

Very much agree with this. There are more than few projects that
could be good for interested students as far as stats and statistical
modelling go.

I know this has come up already, but do we have a wiki page for
proposed GSoC 2010 projects? Better sooner than later probably.

-Skipper

josef...@gmail.com

unread,
Dec 29, 2009, 3:34:39 PM12/29/09
to SciPy Users List

Checking the license again for the MFE toolbox, it seems I was
mistaken that MFE is BSD licensed. The previous version, UCSD Garch
has BSD style license http://www.kevinsheppard.com/wiki/License but
not MFE.
So I might have to drop MFE and switch to UCSD Garch, which has many
functions very similar but not as clean as the MFE version.

5 days of fun partially down the drain, oh well.

Josef

Skipper Seabold

unread,
Dec 29, 2009, 3:48:19 PM12/29/09
to SciPy Users List

Maybe he would make an expressed exception? And come to think of it,
is this enough for inclusion under BSD-style? Though I understand the
basics and the spirit behind the more popular licenses, a lot of the
licensing stuff is beyond me wrt what it actually means, practically
speaking. I definitely err on the side of caution though, and I've
had pretty good luck getting expressed permission or licenses changed
at least for the stuff I've wanted to use for statsmodels. Easier to
write an email than start over...

Wes McKinney

unread,
Dec 30, 2009, 6:25:13 PM12/30/09
to SciPy Users List

+ 1, I would be interested in contributing to the porting effort in
that case that the author will agree to a BSD-style license.

Nathaniel Smith

unread,
Dec 30, 2009, 8:26:59 PM12/30/09
to SciPy Users List
On Tue, Dec 29, 2009 at 12:34 PM, <josef...@gmail.com> wrote:
> Checking the license again for the MFE toolbox, it seems I was
> mistaken that MFE is BSD licensed. The previous version, UCSD Garch
> has BSD style license http://www.kevinsheppard.com/wiki/License but

That license (for UCSD Garch) has an advertising clause; it's not GPL
compatible.

-- Nathaniel

Reply all
Reply to author
Forward
0 new messages