Introduction to Autoregressive models

This tutorial presents introduction of autoregressive models, and theoir implementation in R.

1  AR(1) model

1.1  Model definition


where ({a_t},) is a white noise series of mean zero and variance (sigma_a^2).


  • AR(1) model is widely used not only for returns, as shown with (r_t,) here, but also for volatility with (r_t,) replaced with (sigma_t).
  • Conditional on past return (r_{t-1}), we have conditional mean and variance as following[begin{gather*}mathbb{E}[r_t|r_{t-1}]=phi_0+phi_1r_{t-1}\text{Var}[r_t|r_{t-1}]=sigma_a^2end{gather*}]This is a Markov property in that, conditional on (r_{t-1}), the return (r_t,) is not correlated with (r_{t-i},) for i > 1.

Read more Introduction to Autoregressive models

Stationarity, Autocorrelation, White Noise, and Linear Time Series

This tutorial introduces basic concepts about stationarity, autocorrelation, white noise, and linear time series.

1  Stationarity

1.1  Strict stationarity

A time series {\(r_t\)} is said to be strictly stationary if the joint distribution of \((t_{t_1},\cdots,r_{t_k})\,\) is identical to  \((t_{t_1+l},\cdots,r_{t_k+l})\,\) for all t, where k is an arbitrary positive integer and (\(t_1,\cdots,r_k\)) is a collection of k positive integers.

In other words, strict stationarity requires that the joint distribution of (\(r_{t_1},\cdots,r_{t_k}\)) is invariant under time shift. This is a very hard condition that is hard to verify empirically. Read more Stationarity, Autocorrelation, White Noise, and Linear Time Series

Asset Return and Distributions

This post talks about asset return and distributions, covering various definitions of returns and the relationship among them, return distributions and tests of returns.

1  Asset returns

Most financial studies involves returns, instead of prices, for two reasons:

  1. Return is a complete and scale-free summary of investment opportunity;
  2. Return has more attractive statistical properties than price.

Read more Asset Return and Distributions

Download financial data using R’s quantmod package

This tutorial gives a short intruduction about how to use R’s Quantmod package to retrieve financial time series data from internet.

1  Overview of quantmod package

The quantmod package for R is designed to assist the quantitative trader in the development, testing, and deployment of statistically based trading models. It provides a rapid prototyping environment, where quant traders can quickly and cleanly explore and build trading models. Quantmod makes modelling easier by removing the repetitive workflow issues surrounding data management, modelling interfaces, and performance analysis.

However, quantmod is not a replacement for anything statistical. It has no ‘new’ modelling routines or analysis tool to speak of. It does now offer charting not currently available elsewhere in R, but most everything else is more of a wrapper to what you already know and love about the language and packages you currently use.

Read more Download financial data using R’s quantmod package