R


Linear model for two asset return series

First we’ll get the prices of two ETFs, one is the S&P 500 tracker (SPY) and the other is the US 7-10y Treasury ETF (IEF). For the purpose of regression we will convert into log returns: Now the linear regression where we model the daily S&P 500 returns using the […]


Get Share Prices from Yahoo and plot as zoo Time Series

This gets the S&P 500 time series from Yahoo using the tseries package function get.hist.quote which returns a zoo object. As we’re using ggplot2 we have to convert the zoo series into a data frame.

Alternatively if you don’t want to use ggplot2 the old-school plot function works just […]