Hacking a complex function with Mathematica
I was using Mathematica to explore the power tail behavior of data distributions in finance. My interest was in finding better ways to estimate a tail exponent from limited data. The Pareto distribution represents a distribution of a pure power tail with tail exponent, α. But the distribution can be transformed to an Exponential Distribution.
In[]:=
TransformedDistribution[Log[x],xParetoDistribution[1,α]]
Out[]=
ExponentialDistribution[α]
I was interested in the ExponentialDistribution because it has a simple characteristic function .
In[]:=
CharacteristicFunction[ExponentialDistribution[α],t]
Out[]=
α
-t+α
When I plotted the orbit of the exponential characteristic function on the complex plane, I was surprised to see that it appeared to be a circle radius 1/2 centered at 1/2 on the real axis. I wouldn’t have guessed this from the formula.
In[]:=
ParametricPlotReIm
α
-t+α
/.α3,{t,-10,10}
Out[]=
0.2
0.4
0.6
0.8
1.0
-0.4
-0.2
0.2
0.4
Further exploration reveals that the circle is complete as t  ± ∞.
In[]:=
Limit
α
-t+α
,t∞​​Limit
α
-t+α
,t-∞
Out[]=
0
Out[]=
0
It also appears that the shape of the output is independent of α, but that t could be transformed as a function of α.
In[]:=
ParametricPlotReIm
α
-t+α
/.α1.5,{t,-10,10}
Out[]=
0.2
0.4
0.6
0.8
1.0
-0.4
-0.2
0.2
0.4
So if the visual interpretation is correct, what we have is a circle, radius 1/2, centered at 1/2 + 0 ι.
In[]:=
ParametricPlot[ReIm[1/2Exp[It]+1/2],{t,-Pi,Pi}]
Out[]=
0.2
0.4
0.6
0.8
1.0
-0.4
-0.2
0.2
0.4
Next problem what function of t is being used in the characteristic function formula?
In[]:=
PlotArg
α
-t+α
-12/.α1,{t,-10,10}
Out[]=
-10
-5
5
10
-3
-2
-1
1
2
3
This looks a lot like the ArcTan function.
In[]:=
PlotEvaluateArg
α
-t+α
-12,ArcTan[t]/.α1,{t,-10,10}
Out[]=
-10
-5
5
10
-3
-2
-1
1
2
3
Double the ArcTan and scale t and we have the answer.
In[]:=
PlotEvaluateArg
α
-t+α
-12,2ArcTan[t/α]/.α1.7,{t,-10,10}
Out[]=
-10
-5
5
10
-3
-2
-1
1
2
3
The frosting on the cake . The derived formula will plot on the complex plane a circle radius 1/2, centered at 1/2 from t -∞ to ∞.
In[]:=
CFformula=1/2Exp[I2ArcTan[t/α]]+1/2
Out[]=
1
2
+
1
2
2ArcTan
t
α


In[]:=
CharacteristicFunction[ExponentialDistribution[α],t]​​CFformula%//FullSimplify
Out[]=
α
-t+α
Out[]=
True