Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Adriano
@rsvp

The London Bullion Market Association ceased publishing daily data on their Gold Forward Offered Rate (GOFO), as of 30 January 2015 -- so we develop an observable proxy called tango.

During 2015 we detected strong negative correlation between price change and tango, however, in 2016 that strong correlation became positive -- thus we conclude the relationship is spurious. The observed correlations are mere artifacts which do not imply any significant economic relationships.

Short URL: https://git.io/xau-contango

Adriano
@rsvp
CRITICAL bug fix for our newly revised ema() function for exponential moving averages: rsvp/fecon235@35d3783 -- REMEDY: pull the latest master branch.
Adriano
@rsvp

This site has charted our forks and stars over time: https://porter.io/github.com/rsvp/fecon235 -- "Hacker News Personalized and Delivered"

And here are the search results for "financial economics" repos at their site: https://porter.io/search/?q=financial%20economics

Adriano
@rsvp
Another site which mimics our repository (but not as a clone): https://devhub.io/repos/rsvp-fecon235 -- it even has rewritten my profile. Somewhat strange...
Adriano
@rsvp

Happy Holidays -- new v5.16.1225

Huge revision: qdl-libor-fed-funds.ipynb re Fed rate hikes -- major clarification using transposition and tenor assumptions. Include 2016-12-14 Fed rate hike, and 2017 policy forecast; please see: https://git.io/fedfunds for details. Market is currently aligned with Fed's announced intention of three 25 bp rate hikes during 2017. Implied Fed Funds one-year forward: 1.15%

Adriano
@rsvp
forecast() has been generalized to include an optimization option via grids argument, and will also now accept stock slang, see rsvp/fecon235@dfddf5e
Adriano
@rsvp
Trump inauguration day: 2017-01-20, Implied Fed Funds one-year forward: 1.19% -- output from forefunds('17h', '18h')
Adriano
@rsvp
Pandas will deprecate .ix as of 0.20, so use .loc or .iloc instead. This makes usage more explicit (relying less on magic). fecon235 does not use .ix so no worries.
Adriano
@rsvp
Yellen considering rate hike in March if economy remains strong: 2017-02-15 forefunds('17h', '18h') at 1.25% implied Fed Funds one-year forward (only 10 bp higher from 2016 year-end).
Adriano
@rsvp
Tensorflow has gone 1.0 -- and Keras is now an integral part (see tf.keras) -- the API should be stable for neural networks.
Adriano
@rsvp
Add qdl-xbt-bitcoin.ipynb, new notebook for Bitcoin: We first examine time-series data for price, mining, and capitalization of Bitcoin, then optimize a robust model for the extremely volatile USD price series. Taking the viewpoint of a Chinese user we perform a comparative valuation in Chinese yuan, and also cross-check with the perennial store of value: gold. The astonishing volatility and geometric return makes Bitcoin a speculative financial asset which may hinder it as a payment system. Shortcut: https://git.io/xbt
Adriano
@rsvp
Latest release: https://github.com/rsvp/fecon235/releases/tag/v5.17.0221 -- the different underlying database sources should now be operational compatible with among themselves. Thus out-of-the-box fecon235 will not require awkward renaming of columns and indexes, especially for time-series data not in our lexicon.
Adriano
@rsvp
Yellen expects rate hike on March 15... 2017-03-02 forefunds('17m', '18m') at 1.22% implied Fed Funds one-year forward -- which is in line with street expectations of "two and a half" 25 bp increases in the coming year.
Adriano
@rsvp
Remember when pizza cost 1,000 Bitcoins? Well, that now gets you about 1,000 troy oz. of gold, roughly worth $1.22 million USD -- see our Notebook https://git.io/xbt and rerun the XBTXAU section.
Adriano
@rsvp

Polished https://git.io/gdpspx -- We examine the US gross domestic product's relationship to the US equity market (S&P500), in real terms. Forecasts for both are demonstrated using Holt-Winters time-series model. We derive the most likely range for real GDP growth, and identify extreme equity valuations aside from inflationary pressures.

Our analysis would suggest the following back of the envelope calculation: say, SPX nominally has an annual gain of 6% and inflation stands at 2%, then the real SPX gain is 4%. Take half of that to arrive at real GDP growth: 2%. Helpful because GDP numbers are announced after months of lag.

Adriano
@rsvp
Awesome listing... best-of Python libraries: https://github.com/vinta/awesome-python -- and our PR for inclusion is up for voting: vinta/awesome-python#878
Adriano
@rsvp
Equities are near all-time highs, yet over the decade, money managers are increasingly short. That capacity against the "uninformed" is being tested. Here we plot(get(w4cotr_equities)) which derives from CFTC Commitment of Traders Reports for combined pool of SP and ES futures and options representative of the S&P 500:
COTR equities 2017-04-26
Adriano
@rsvp
If fecon235 has been helpful to you, please show us +1 :+1: support at https://git.io/fe-awesome -- that awesome-python project lists many excellent resources worth checking out.
Adriano
@rsvp
NY Fed Reserve's general equilibrium model, rewrite in Julia: http://frbny-dsge.github.io/DSGE.jl/latest/julia_forecasting.html / Repo at https://github.com/FRBNY-DSGE/DSGE.jl but their Kalman state space models are refactored at https://github.com/FRBNY-DSGE/StateSpaceRoutines.jl
Adriano
@rsvp
By the way, details for the CFTC Commitment of Traders Reports Jupyter notebook is here: https://git.io/cotr discerns how various asset classes are positioned in the market.
Adriano
@rsvp
Nice post by @willkurt Kullback-Leibler Divergence Explained
Mark Song
@lnsongxf
Hi, I just want to know how to install fecon235, I tried "pip install fecon235", but it doesn't work. Thx.
Adriano
@rsvp

@lnsongxf hi, the preferred way for installation is just to clone the project under a directory in your PYTHONPATH. Best way to establish that editable variable is installing Anaconda beforehand which will resolve complex package dependencies. Then https://git.io/fecon-intro will help. Please message me if there are any other problems -- will revise the documentation accordingly.

Another way is non-native but direct cross-platform, Docker container : https://hub.docker.com/r/rsvp/fecon235/ -- Anaconda and git are pre-installed so just pull from origin/master to get latest fecon235 updates.

Adriano
@rsvp
The anomalies literature is infested with widespread p-hacking.” Even Fama and French are indicted… http://theinvestmentcapm.com/Slides_Replication_2017May_OhioState.pdf / Paper: http://www.nber.org/papers/w23394 [Hou 2017]
Mark Song
@lnsongxf
@rsvp I clone the project under a directory in my PYTHONPATH,and it works, thanks for your kindly help.
Adriano
@rsvp
@lnsongxf Great! Your feedback would be much appreciated, here or in issues https://git.io/fecon235is -- enjoy.
Adriano
@rsvp
Adriano
@rsvp
Fed is preparing to gradually roll-off maturing assets on their balance sheet, currently at $4.5T -- passive QE reversal of sorts. Probably will reinvest mortgage securities though to sell off later should the housing market overheat.
AnneFacun
@annefacun
Hi!
Adriano
@rsvp
forefunds('17m', '18m') forecasts average Fed Funds rate at 1.23% one year out, implying one or two 25 bp hikes expected through June 2018.
Adriano
@rsvp
Next FOMC presser on 14 June 14:00 eastern.
Adriano
@rsvp

Quick look at equities in France since 2014, which covers Hollande malaise, Le Pen market fears, and Macron as President:

>>> fr = get('s4ewq')
 ::  Retrieved from Google Finance: EWQ
>>> fr14 = fr['2014':]
>>> roundit(gemrat(fr14))
[-0.6532, 1.6122, 19.0886, 15.7456, 256, 857]
>>> plot(fr14, 'FR_eq_2014-Macron')

plotdf-FR_eq_2014-Macron.png

The geometric mean rate is sub-zero, despite recent rally. The volatility is reasonable 19%, but the kurtosis is rather high at 15.7 (vs. 3 for a Gaussian). The function gemrat will be included in our next release.

Adriano
@rsvp
By the way, EWQ is the ETF based on French equities, and the +1.6% figure represents the arithmetic mean rate which gets penalized for leptokurtosis ("fat tails").
Adriano
@rsvp
Nice utility to strip output cells from Jupyter notebooks: https://github.com/kynan/nbstripout -- useful for compact commits in version control.
Adriano
@rsvp
New release: https://github.com/rsvp/fecon235/releases/tag/v5.17.0603 -- see esp. https://git.io/gmix where we analytically and visually show how a Gaussian Mixture model handles "fat tail" risk of leptokurtotic financial assets under small-sample conditions.
Adriano
@rsvp

It is very interesting that Berkshire Hathaway has accumulated more than 100 million shares of Apple recently, which has a geometric mean rate of 16.6% over the last ten years -- extraordinary growth:

 >>> gm2gem(get('s4aapl'))
Geometric  mean rate: 16.5693
Arithmetic mean rate: 22.4526
sigma: 32.8234
kurtosis (Pearson): 10.3151
GM(2), sigma1: 24.0206
GM(2), sigma2: 82.0585
GM(2), q:  0.0813
GM(2), b:  2.5
yearly: 256
N: 2512

and the above does not include dividend yield of 1.6%. The Gaussian mixture model deduces two volatilities: 24% and 82%, the latter occurring with probability 0.0813.

In contrast, BRK.A pays no dividends and has less a third of Apple's geometric growth (only 4.7% over the same period). It seems strange for value equities that Berkshire returns exhibit extremely high kurtosis of 21.4 (which compares to 3 for an ordinary Gaussian, and 10.3 for Apple).

Adriano
@rsvp
Highlighted by some Machine Learning for Finance and Economics fans at Facebook: https://www.facebook.com/machinelearning4financeeconomics/posts/1808618849376095 -- Thanks!
Adriano
@rsvp
Updated notebook on realized geometric returns https://git.io/georet which now uses the new more accurate gemrat() function, see https://git.io/gmix -- the section on monthly geometric returns is insightful for asset allocation: comparison across real estate, stocks, bonds, gold, and FX from the viewpoint of USD-based investor.
Adriano
@rsvp
The current Fed Funds range is between 100 and 125 bp. Our forefunds('17u', '18u') is forecasting 146 bp one year out, thus only one more rate hike is expected. Most expect this to happen in December 2017. As for bonds, FOMC is willing to start reducing holdings on its balance sheet, i.e. reverse quantitative easing.
Adriano
@rsvp

Our inflation measure is a composite of CPI and PCE, both core and headline versions for each.

>>> infl = get(m4infl)
>>> roundit(gemrat(infl['2015':], yearly=12))
[1.6045, 1.6052, 0.3525, 5.8699, 12, 28]

The volatility is so low (0.35%) that the geometric and arithmetic rates of inflation are very close: 1.6%. The Fed target is 2%, core PCE basis, so they are currently off by about 1 standard deviation. Yellen in her recent testimony seemed puzzled given the labor market situation.

To score the Federal Reserve's performance under its dual mandate for inflation and unemployment, rerun this Jupyter notebook using current data, https://git.io/fed

esvhd
@esvhd
@rsvp, thank you for the great set of notebooks. On the fed score, love it by the way, I am wondering if the z-scoring of inflation should take a short time horizon, due to the fact that due to structural changes, inflation series far behind most likely is not relevant. therefore including the hyper-inflation periods would optically depress the inflation z-scores. Perhaps I can try a trailing 10yr scoring for inflation? What do you think?
Adriano
@rsvp
hi @esvhd thanks! The notebooks are just proof of concept for the algos, "usage examples." You are seeking short-term memory, so one could window the dataframe[t-w:t] for fixed window size w as time rolls forward. Any sort of filtering should apply to the inflation as well as the unemployment side. The Fed policy objectives also change over time, but our notebook depicts them as being constant. Thus any localized evaluation should account for that, just to be more fair.
Adriano
@rsvp
NEW RELEASE v5.17.0722: We develop an alternative to the Markowitz framework called Boltzmann portfolios which handle uncertainty from the standpoint of cross-entropy and optimal sequential decisions. The improved result is a faster online algorithm which is more robust. Markowitz portfolios are designed in the arithmetic mean-variance framework for a static period, and are fragile to changing market conditions. In contrast, Boltzmann portfolios are adaptive over multi-periods to geometrically maximize wealth using techniques from reinforcement learning. Part 1: https://git.io/boltz1 Part 2: https://git.io/boltz2
esvhd
@esvhd
Hi @rsvp thanks for the reply! Sorry took me a while to get back. Indeed, the objectives do vary with time, like now, infltaion is more of the driver than unemployment. Congrats for the new release!
Adriano
@rsvp

Insomnia last night, created this word cloud: https://git.io/fecon235words :worried:

fecon235-wordclouds.jpg

Adriano
@rsvp
In https://git.io/oil we examine the crude oil markets, specifically the Brent over WTI spread, and construct an optimal Boltzmann portfolio. Deflated time-series indicates $20 in current dollars as bottom support. Grim for oil companies whose break-even point is around $47.
Adriano
@rsvp

Re: #2 -- Git shell script to list commit dates, given path/filename(s)

The system's modification time for a committed file may not
be the actual commit date and time!
This can be verified
if you checkout an older branch and switch back.

There is no nice builtin git utility, so I wrote one:
https://git.io/git-lu

Adriano
@rsvp
@MaxBenChrist started awesome list for "python ecosystem contains different packages that can be used to process time series": https://github.com/MaxBenChrist/awesome_time_series_in_python
Maximilian Christ
@MaxBenChrist
@rsvp Thank you for adding me to this room.
I am overwhelmed by the scope of your package. you really have a huge amount of examples.