S23OrderDistribution tits to DJIA from 1900 to 1950

This notebook fits the Dow Jones Industrial Average in two year intervals to an S23OrderDistribution with good quality results. Apparently market log returns have a distributional shape which has not changed since all the trades were executed by hand and the best information technology was telephone and ticker tape, both of which generally failed in extreme markets. Human behavioral interactions with financial markets does not seem to be affected much by modern technology.
This is an extended data set of the Dow Jones Industrial Average obtained from https://www.measuringworth.com/datasets/DJA/. It includes Saturday trading in the early series.
In[]:=
djiaT=ImportByteArrayByteArray
264.6 kB

Out[]=
Tabular
Row count: 38314
Column count: 2

In[]:=
Needs["S23OrderDistribution`"]
In[]:=
tickerSymbol="DJIA";
In[]:=
Clear[S23DJIAFit];​​S23DJIAFit[djiaData_]:=Module[{lr,pLevel,lrQrng,lrD,parm0,skd,dt,α,β,μ,σ,s23d,HTs23d},​​​​Print[DateListPlot[djiaData,PlotRangeAll,JoinedTrue,GridLines->Automatic,PlotLabeltickerSymbol<>" Closing Price"]];(*Print[DateListLogPlot[data,PlotRangeAll,JoinedTrue,PlotLabeltickerSymbol<>" Closing Price\nLog Scale"]];*)​​lr=Differences[Log[djiaData[[All,2]]]];​​dt=Rest[djiaData[[All,1]]];​​pLevel=0.02;​​lrQrng=Quantile[lr,{pLevel,1-pLevel}];​​Print[DateListPlot[Tooltip@{Transpose[{dt,lr}],Select[Transpose[{dt,lr}],!lrQrng[[1]]<#[[2]]<lrQrng[[2]]&]},PlotStyle{{StandardBlue,PointSize[0.01]},{StandardRed,PointSize[0.01]}},PlotRangeAll,Joined->False,GridLines->Automatic,PlotLabeltickerSymbol<>" Daily Log Returns\np = "<>ToString[pLevel,TraditionalForm]<>" Extremes Red"]];​​lrD=EmpiricalDistribution[lr];​​​​s23d=EstimatedDistribution[lr,S23OrderDistribution[α,β,μ,σ]];​​​​parm0=List@@s23d;​​​​Print[tickerSymbol,​​" Stable 2:3 Order Statistic Distribution Parameters, {α, β, μ, σ, type}:\n",parm0,"\nDistribution Fit Test"];​​HTs23d=DistributionFitTest[lr,s23d,"HypothesisTestData"];Print[HTs23d["TestDataTable",All],"\n"];​​​​Print[LogLogPlot[{CDF[lrD,-x],1-CDF[lrD,x],CDF[s23d,-x],1-CDF[s23d,x]},{x,0.001,Max[Abs[lr]]5/4},PlotRangeAll,PerformanceGoal"Speed",FrameTrue,GridLinesAutomatic,PlotStyle{StandardBlue,StandardRed,StandardBlue,StandardRed},PlotLabeltickerSymbol<>" Tail Fit with Empirical Distribution"]];​​skd=SmoothKernelDistribution[lr];​​Print[Plot[{PDF[s23d,x],PDF[skd,x]},{x,Min[lr],Max[lr]},PlotRangeAll,PerformanceGoal"Speed",PlotLabeltickerSymbol<>" PDF - Blue\nEmpirical PDF - Yellow"]];​​];
In[]:=
djiaData=Select[djiaT,DateObject[{1900,1,1}]<#Date<DateObject[{1902,1,1}]&]//Normal//Values;​​S23DJIAFit[djiaData]
S23OrderDistribution`Private`s23maxlike
::count
:There are 129 nonpositive PDF values.
​
S23OrderDistribution`Private`s23maxlike
::count
:There are 129 nonpositive PDF values.
​
S23OrderDistribution`Private`s23maxlike
::count
:There are 129 nonpositive PDF values.
​
General
:Further output of S23OrderDistribution`Private`s23maxlike::count will be suppressed during this calculation.
DJIA Stable 2:3 Order Statistic Distribution Parameters, {α, β, μ, σ, type}:{2.88398,-0.231366,-0.00171574,0.0101111,1}Distribution Fit Test
Statistic
P-Value
Anderson-Darling
0.236162
0.977216
Cramér-von Mises
0.0320018
0.969138
Pearson
2
χ
33.9324
0.10936
In[]:=
djiaData=Select[djiaT,DateObject[{1902,1,1}]<#Date<DateObject[{1904,1,1}]&]//Normal//Values;​​S23DJIAFit[djiaData]
S23OrderDistribution`Private`s23maxlike
::count
:There are 16 nonpositive PDF values.
​
S23OrderDistribution`Private`s23maxlike
::count
:There are 16 nonpositive PDF values.
​
S23OrderDistribution`Private`s23maxlike
::count
:There are 16 nonpositive PDF values.
​
General
:Further output of S23OrderDistribution`Private`s23maxlike::count will be suppressed during this calculation.
DJIA Stable 2:3 Order Statistic Distribution Parameters, {α, β, μ, σ, type}:{2.48468,-0.0638796,-0.00150395,0.00858941,1}Distribution Fit Test
Statistic
P-Value
Anderson-Darling
0.203158
0.989528
Cramér-von Mises
0.0275736
0.98344
Pearson
2
χ
23.6252
0.541104