A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| ''' | |
| Author: Skipper | |
| https://gist.github.com/2109628 | |
| Josef: adjustments to example | |
| ''' | |
| from statsmodels.base.model import LikelihoodModel |
| # If not running interactively, don't do anything | |
| [ -z "$PS1" ] && return | |
| # don't overwrite GNU Midnight Commander's setting of 'ignorespace'. | |
| export HISTCONTROL=$HISTCONTROL${HISTCONTROL+,}ignoredups | |
| # ... or force ignoredups and ignorespace | |
| export HISTCONTROL=ignoreboth |
| """ | |
| Self-Exciting Threshold Autoregression | |
| References | |
| ---------- | |
| Hansen, Bruce. 1999. | |
| "Testing for Linearity." | |
| Journal of Economic Surveys 13 (5): 551-576. | |
| """ |
| """ | |
| Smooth Transition Autoregression | |
| References | |
| ---------- | |
| Dijk, Dick van, Timo Terasvirta, and Philip Hans Franses. 2002. | |
| "Smooth Transition Autoregressive Models - a Survey of Recent Developments." | |
| Econometric Reviews 21 (1): 1-47. |
| import math | |
| import numpy | |
| import numpy.random as nrand | |
| """ | |
| Note - for some of the metrics the absolute value is returns. This is because if the risk (loss) is higher we want to | |
| discount the expected excess return from the portfolio by a higher amount. Therefore risk should be positive. | |
| """ |
| This is free and unencumbered software released into the public domain. | |
| Anyone is free to copy, modify, publish, use, compile, sell, or | |
| distribute this software, either in source code form or as a compiled | |
| binary, for any purpose, commercial or non-commercial, and by any | |
| means. | |
| In jurisdictions that recognize copyright laws, the author or authors | |
| of this software dedicate any and all copyright interest in the | |
| software to the public domain. We make this dedication for the benefit |