Tag: macro

Macro: NIFTY vs. INR/OIL Correlation, Part II

This is a continuation of the correlation study of Part I
Our correlation study showed a -0.54 between NIFTY 50 and USDINR whereas a 0.21 with OIL. Here, we will use weekly returns of the NIFTY and USDINR to build a simple linear model.

Building a linear model

A weak correlation doesn’t usually lend itself to a useful linear model. To illustrate this point, have a look at the diagnostics below:
NIFTY~INR linear model
Ideally, the ‘Residuals vs. Fitted’ plot should show residuals evenly distributed around the zero line – it doesn’t. The Q-Q plot should lie on the diagonal – it is marred by heavy tails. Hence, we should scale-down our expectations from the model.

For this post, we will split the time-series that we have into a “training set” that goes from 2010-01-01 to 2015-12-31 and a “test set” that goes from 2016-01-01 to 2018-09-30. We will build the model with the former and test it with the latter.

Results

Predicted vs. actual weekly NIFTY 50 returns:
actual.vs.pred.NIFTY50
To test our model, we will give it the actual NIFTY 50 returns (x-axis) and plot the predict NIFTY 50 returns (y-axis.) The problem here is immediately apparent: it is heavily bullish! It consistently gives a positive prediction.

Long and Long-short cumulative returns:
linear.model.cumulative.NIFTY50
If we use our model to go long-only (L) or long-short (LS), we get the cumulative returns shown above. The model is no better than buy-and-hold (at least it is no worse, so there is that.)

Take-away

A weak correlation between NIFTY 50 and USDINR is not much to work with and a linear model built over that relationship is no better than buy-and-hold. Given the narrative spun by the media, it is tough to wrap ones head around the results above.

We conclude with density charts of weekly NIFTY returns under different USDINR return thresholds in Part III.

Code and charts on github.

Macro: NIFTY vs. INR/OIL Correlation, Part I

We have all come across these type of headlines recently:
Sensex, Nifty fall further on surging crude oil prices (LiveMint)
Sensex, Nifty drop on fresh spurt in oil price, fall in rupee (ET)
But what exactly is the correlation between the NIFTY, USDINR and OIL?

Macro Caveats

A host of factors affect the prices of a widely tracked benchmark index like the NIFTY. Some of which are intrinsic (valuation, for example) and some that are external (capital flows, for example.) There relationships are dynamic – they keep changing over time.

Also, macro variables usually have a time-alignment problem. For example, the closing-prices of the NIFTY don’t align with the closing prices of, say, the NASDAQ. So to analyze the NIFTY and NASDAQ together, the time-series need to be shifted. And, perhaps, NASDAQ futures being traded at NIFTY close should be considered instead.

Comparing commodity and currency time-series with equity time-series has another problem. The former trades 24/7 in a global marketplace whereas equities predominantly trade in the local time-zone. So “closing” prices for commodities and currencies are hard to pin down at a granular level across markets. One way to tide over this issue is by using a weekly or monthly time-series instead of a daily one.

Time-periods

For the longest time, Indian markets were insulated from global capital flows. It is only recently that we have opened up both or economy and our markets. Currency futures started trading only in 2008 and the RBI still tries to “guide” the exchange rate. With these in mind, lets run the correlation between the NIFTY 50, USDINR and OIL weekly return time-series with NIFTY 50 lagged by on time-period.

NIFTY50.INR.OIL correlations

Data from 1995 through 2018 shows only a small correlation between NIFTY and INR. However, like we mentioned above, Indian markets now are more open than what they were before. So, if you run the same correlations on a smaller dataset – year 2010 through 2018 – we can see an uptick in the NIFTY-INR correlation.

NIFTY50.INR.OIL correlations

Take-away

It appears that the NIFTY has a closer relationship with INR than with OIL prices. In Part II of this thread, we will check if we can build a linear model that can capture this relationship. Stay tuned.

Code and charts are on github.

Introducing the Global Macro Dashboard

It is all local until it is not

World markets just witnessed a spiraling sell-off that caught most investors off-guard. The problem is that for most of the time, markets are local. Except for those times when they aren’t and correlations go to 1.

We tried singling out different factors to check if they could act as leading indicators of market sell-offs:

It is not one thing and it is never the same thing

The problem is that, statistically, no one global indicator is going to be a perfect canary in the coal mine. However, once the number of “meaningful” events crosses a threshold, correlations tend to 1.

But what exactly defines “meaningful?” Is it 1-sigma or 2-sigma? Should it be change in price or price itself? What should be the number of periods over which these statistics are calculated? The answers to these questions are going to take a while to figure out. In the meantime, we decided to create a dashboard that lets investors choose some of these filters.

You can play with our Global Macro Dashboard here: StockViz/GlobalDashboard

Welcome to glocal markets.

Macro Update July 2015

US TREASURIES VS. GILT SPREAD

The spread between 10yr US Treasuries and Indian Gilts remained within a tight range this month.

ust-ind-10yr-spread.2011-01-18

Long term US Treasury yields compressed.

ust-yield-curve.2015-06-30

Institutional investments

FIIs were net buyers in July. A welcome relief after June’s selloff.

fii-investments.2014-01-01.2015-07-31

DIIs joined the bandwagon as well.

dii-investments.2014-01-01.2015-07-31

Oil

Oil got shellacked.

wti-brent.2011-01-18

Gold

Gold got shellacked too.

gold.usd

Copper

Copper got shellacked three.

copper.usd

US Dollar

Here is the rally in US Dollar charted:

usd_fut_chart

Outlook

The fall in commodity prices should be a huge windfall for the Indian economy. However, the pace of reforms have come below expectations. The Monsoon Session of the parliament has been a disappointing mess. This has resulted in extended valuations in quality stocks. With a US rate-hike expected in September, we may see a bit of a wobble that might prove to be an excellent time to “buy the dip.”

Macro Update June 2015

US TREASURIES VS. GILT SPREAD

The spread between 10yr US Treasuries and Indian Gilts remained within a tight range this month.

ust-ind-10yr-spread.2011-01-18

Long-term bond yields continued their ascent:

ust-yield-curve.2015-06-01

INSTITUTIONAL INVESTMENTS

FIIs came back to the debt market but took money out of equities…

fii-investments.2014-01-01.2015-06-30

… while DIIs gulped down debt as well.

dii-investments.2014-01-01.2015-06-30

Oil

Oil futures remained flat.

wti-brent.2011-01-18

Gold

If all the uncertainties cannot move gold up, I am not sure what will.

gold.usd

Copper

After a brief period of enthusiasm, it looks like copper has given up on industrial growth again.

copper.usd

Dollar Index

Looks like the dollar index (DXY) has found a range.

Outlook

Although the Indian markets have shrugged off Grexit for now, nobody really knows the extent to which the contagion can spread. It’s basically a known unknown at this point.

With the monsoon expected to be normal and earnings to begin in earnest only by the end of July, the first couple of weeks of July is going to be driven by optimism.