Student T Fit

Looks at Student T distribution fit to the S&P 500 log return series.

This notebook uses same time-series of log returns for the S&P 500 as the MarketReturnDistribution notebook.  That notebook contains a number of plots which will not be shown again here.

data= FinancialData["SP500",All];
CellPrint[TextCell["Start ... "<>DateString[First[data][[1]],"Date"],"Text"]]
CellPrint[TextCell["End ... "<>DateString[Last[data][[1]],"Date"],"Text"]]
lp= Log[data[[All,2]]];
lr=Differences[lp];

Start ... Tuesday 3 January 1950

End ... Friday 25 October 2013

Unlike the stable distribution, the Student T distribution can fit a wide range of tail behavior, extending from very heavy tails to the normal tails as the parameter, ν -> ∞.  The Student T tail behavior tends to occur more smoothly and more centrally, where as in the stable distribution as α -> 2, the tail behavior appears abruptly further and further from the center of the distribution.  Below is the histogram, the smoothed empirical density and the Student T distribution fit for the series of log returns.  The fit is pretty good for the center of the distribution.

stdist=EstimatedDistribution[lr,StudentTDistribution[μ,σ,ν]];
skd=SmoothKernelDistribution[lr];
q1=Histogram[lr,Automatic,"ProbabilityDensity",PlotRange->All];
q2=Plot[{PDF[skd,x],PDF[stdist,x]},{x,Min[lr],Max[lr]},PlotStyle->{{Darker[Red],Thick},{Darker[Green],Thick}},PlotRange->All];
Show[q1,q2,Frame->True,PlotRange->{{-0.05,0.05},All},PlotLabel->"Histogram Log Returns - Blue\nEmpirical Density - Red\nStudent T Distribution Fit - Green"]

The tail fit is also pretty good, with the tail exponent, α or ν, of 3.1 being closer to the actual tail behavior of the data.  This is a symmetric distribution so it cannot fit the tails separately; in this case the left tail has a better fit than the right tail (red).

ed=EmpiricalDistribution[lr];LogLogPlot[{CDF[ed,-x],1-CDF[ed,x],CDF[stdist,-x],1-CDF[stdist,x]},{x,0.01,Max[Abs[lr]]},PlotRange->All,PlotStyle->{Darker[Blue],Darker[Red],Darker[Blue],Darker[Red]}, PerformanceGoal->"Speed",Frame->True,GridLines->Automatic,PlotLabel-> "Log Log Distribution Function\nStudent T Fit"]
CellPrint[TextCell["Student Parameters, {μ, σ, ν}: "<>ToString[{stdist[[1]],stdist[[2]],stdist[[3]]}],TextAlignment->Center]]

Financial Data Analysis Home

CellPrint[TextCell["\n\n© Copyright " <> ToString[DateList[][[1]]] <> " Robert H. Rimmer, Jr.    " <> DateString[DateList[], "DateShort"], "Text"]]

© Copyright 2013 Robert H. Rimmer, Jr.    Sun 27 Oct 2013