(*LNN and StableM are available on the Software Page*)
Needs["LNN`","C:\\Mathematica 6\\LogNormalStable\\LNN.m"];

A New View of Risk

The lognormal - normal mixture distribution (LNN) gives a very good fit to financial data.  Its parameters also provide an new insight into risk.  We have defined three parameters for the distribution, {γ, σ, δ}.  γ and δ are analogous to the stable scale factor and location parameter, with δ also being the expectation of the distribution.  Since our distribution is of logarithmic returns, δ is the expected logarithmic return.  We will start with some data.  Three years of SPY.

ticker="SPY";
data=FinancialData[ticker,"Close",Take[DateList[],3]-{3,0,0}];
DateListPlot[data,Joined->True,PlotLabel->ticker,PlotRange->All]

LogReturn[data_]:=Differences[Log[N[data]]];
lr= LogReturn[data[[All,2]]];
pp=Quiet[LNNFit[lr]];
CellPrint[TextCell["LNN Parameters {γ, σ, δ} = "<>ToString[pp], "Text"]];

LNN Parameters {γ, σ, δ} = {0.00485112, 0.541252, 0.000604314}

Here is the log-log fit.  The data has some asymmetry, but this is a symmetric distribution, nevertheless the risk at the tails in the data is well described by the distribution.  Click this link for gallery of fits to data of all the stocks in the Dow Jones Industrial Average.

EmpiricCDFList[data_] := Block[{prob,sel,del},								prob= Table[(i-0.5)/Length[data],{i,Length[data]}];
					Transpose[Join[{Sort[data]},{prob}]]];
DisplayLogLogFit1[data_,parm_]:=Module[{clist,lt,rt,trt,lp1,lp2,lp3,lp4,lp5,nmn,nstd},
clist=EmpiricCDFList[data];
	lt = Select[clist,#[[1]]<0&];
	rt= Select[clist,#[[1]]>0&];
	trt=Transpose[rt];
lp1=ListLogLogPlot[Abs[lt],PlotStyle->Blue,PlotRange->All];
	lp2=ListLogLogPlot[Transpose[{trt[[1]],1- trt[[2]]}],PlotStyle->Red,PlotRange->All];

lp5= LogLogPlot[1-LNNCDF[x,parm[[1]],parm[[2]],parm[[3]]],{x,0.0001,-2Min[data]},PlotStyle->Green,PlotRange->All,PerformanceGoal->"Speed"];
Show[lp1,lp2,lp5,PlotLabel->"Log Log Left Tail Blue, Right Red, (Lognormal Normal Green)",AspectRatio->Automatic,PlotRange->All,Frame->True]];DisplayLogLogFit1[lr,pp]

Below are the plots of the two densities that create our distribution function.  The concept of LNN is that it describes a random variable a product of a random variable from each of these two distributions.  The normal distribution on the left has its mode at the mean, 0, and its scale factor is adjusted to the stable scale factor of 1.  The lognormal distribution is characterized by parameters μ, and σ.  In the LNN representation μ is given the value log(γ) and σ is the same as our σ parameter.  Thus the risk is uniquely pictured in the density of the lognormal distribution, which tells something about the shape of volatility.

g1=Plot[PDF[NormalDistribution[0,Sqrt[2]],x],{x, -5,5},PlotRange->All,Frame->True,PlotLabel-> "Normal Distribution"];
g2= Plot[PDF[LogNormalDistribution[Log[pp[[1]]],pp[[2]]],x],{x,0,0.03},PlotRange->All,Frame->True,PlotLabel-> "Lognormal Distribution"];
GraphicsRow[{g1,g2}]

The normal distribution random variable has constant parameters.  It adds a noise factor to the lognormal random variable which has two parameters that characterize the risk.  This noise is a product not an addition so its effect to significantly broaden the mass of the tails of the distribution.  All of the risk in the LNN distribution is represented by the lognormal distribution parameters.  The x-axis of the lognormal distribution represents the scaling of the normal distribution noise and the y-axis is the weight assigned to the value on the x-axis.  The following relationships describe the lognormal part of the distribution.

γ is the median of the lognormal distribution.

The mode is located at γ (e^(-(σ^2))).

The expectation of the lognormal distribution is  γ (e^((σ^2)/2)).

The standard deviation of the lognormal distribution is γ (e^((σ^2)/2))(Sqrt[(e^(σ^(2 )))-1]).

Thus if σ were 0 the scale factor of the stable noise would be γ and there would be no dispersion of the noise.  As σ grows the risk is spread out.  The graph below shows the lognormal distribution with γ set to 0.01 and σ at 0.3, blue, 0.5, red.

Plot[{PDF[LogNormalDistribution[Log[0.01],0.3],x],PDF[LogNormalDistribution[Log[0.01],0.5],x]},{x,0,0.04}]

As σ grows the risk multiplier has more extreme events in its probability distribution.  On the next page we take up generation LNN Random variables.

txcolor=RGBColor[181/255,18/255,27/255];
t1 = Graphics[Text[Hyperlink[Framed[Style["Financial Home", {txcolor, Bold, Larger}]], "../map/Overview.html"], {-5, 0}]];
t2 = Graphics[Text[Hyperlink[Framed[Style["Next", {txcolor, Bold, Larger}]],  "../lnn3/LNNRV.html"], {0, -0.5}]];
t3 = Graphics[Text[Hyperlink[Framed[Style["Download Notebook", {txcolor, Bold, Larger}]], "../lnn1/LNNRisk.nb"], {5, 0}]];
t4 = Graphics[Text[Hyperlink[Framed[Style["Previous", {txcolor, Bold, Larger}]], "../lnn0/LognormalNormal.html"], {0, 0.5}]];

Show[ t1, t2, t3,t4, ImageSize -> 500]
CellPrint[TextCell["\n\n© Copyright " <>ToString[DateList[][[1]]]<>" mathestate    "<>DateString[DateList[],"DateShort"], "Text"]]

© Copyright 2008 mathestate    Wed 18 Jun 2008