Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to the GARCH implementation #56

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

Upgrade to the GARCH implementation #56

wants to merge 12 commits into from

Conversation

Teo-ShaoWei
Copy link

Please refer to issue #53.

ShaoWei Teo added 3 commits October 26, 2015 20:23
- Bring out the old GARCH test file.
- Enable `garch.jl` for REPL testing.
- Wrap REPL testing in `all.jl` with a test capsule module.
- Update GARCH test to remove depreciated constructs, and use `FactCheck` for testing.
- Create a random process file to run GARCH on.
- Include dependent packages locally.
- Remove method `garchPkgTest`.  Not necessary to do test in source code.
With the change, the output shows small values in the range of 10e-6 correctly.  The formatting is more consistent, since numbers that are too long will no longer burst the tab limit.  Also the χ² symbol shows correctly on Juno.
@Teo-ShaoWei
Copy link
Author

I passed the test on my local system. However the test failed on Travis CI because there is no NLOpt package. How should I resolve it?

ShaoWei Teo added 3 commits October 26, 2015 20:57
The variables names are chosen as per Bollerslev's GARCH paper so it is easier to read the code and paper together.
Do only cosmetic changes.  There is rename of variables, removal of semicolon after statements, adding of the return statement, mainly things that make the code more Julia-like.
@Teo-ShaoWei
Copy link
Author

I think it is better to house each model separately in their own submodule. If the aim of the TimeModels module is to showcase individual models, then it may be good to compartmentalize them so that anyone can just grab the local files and be able to replicate the models.

Currently, we need to go to TimeModels.jl to obtain the various using and export statements before we can reproduce a local model.

@Teo-ShaoWei
Copy link
Author

Its ok, I passed the Travis CI test by putting NLopt as a dependency package.

@Teo-ShaoWei
Copy link
Author

By the way, I added a test capsule module wrap in all.jl. For REPL and Juno user who do TDD, any change to types will result in a restart if we do not do the wrap.

@Teo-ShaoWei
Copy link
Author

After working with the code, I realized that this is just a GARCH(1, 1) implementation. The volatility process is not derived correctly. Also, the package and functions used may be outdated, and there may be better ways to represent them. Lastly, the notation deviates from the original paper by Bollerslev. In the spirit of providing Julia examples of these models, we may want to keep the notation closer to the original.

These are things that I will try to do going ahead. Any recommendation or help to this PR is greatly appreciated =)

@Teo-ShaoWei
Copy link
Author

Thanks for the input @milktrader. Do keep the suggestion coming. I will continue to give the original code a face lift until I fully understood the code. Then I will upgrade its functionality.

ShaoWei Teo added 5 commits October 27, 2015 15:32
The process `y` that GARCH takes in will be processed to form its error process `ɛ`.  It should not be processed outside of GARCH.  Update the test to reflect this.
In GARCH, there is no assumption that mean should be zero-ed.  Popular implementations, like MATLAB's `garch`, or R's `fGarch` and `rugarch`, all does not perform zeroing.  Add in comment to the test to remind user to zero their own mean first before fitting GARCH.
…time we need to use it.

There is some speedup, and less total memory creation is done as we do not need to recreate the `ɛ²` array every time we need it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants