I have developed some code to generate random variates from the product of a LogNormalDistribution and a StableDistribution:
LNStableRV[{\[Alpha]_, \[Beta]_, \[Gamma]_, \[Sigma]_, \[Delta]_},
n_] := Module[{LNRV, SDRV, LNSRV},
LNRV = RandomVariate[LogNormalDistribution[Log[\[Gamma]], \[Sigma]],
n];
SDRV = RandomVariate[
StableDistribution[\[Alpha], \[Beta], \[Gamma], \[Sigma]], n];
LNRV * SDRV + \[Delta]
]
(* Note the delta serves as a location parameter *)
I think this works fine:
LNStableRV[{1.5, 1, 1, 0.5, 1}, 50000];
Histogram[%, Automatic, "ProbabilityDensity",
PlotRange -> {{-4, 6}, All}, ImageSize -> 250]
ListPlot[%%, Joined -> True, PlotRange -> All]
Now I'd like to create a TransformedDistribution along the same lines so that I can use PDF[], CDF[], etc. on this custom distribution and easily do plots and other analysis.
Extrapolating from an example in Documentation Center > TransformedDistribution:
\[ScriptCapitalD] =
TransformedDistribution[
u v, {u \[Distributed] ExponentialDistribution[1/2],
v \[Distributed] ExponentialDistribution[1/3]}];
I've tried this:
LogNormalStableDistribution[\[Alpha]_, \[Beta]_, \[Gamma]_, \
\[Sigma]_, \[Delta]_] := Module[{u, v},
TransformedDistribution[
u * v + \[Delta], {u \[Distributed]
LogNormalDistribution[Log[\[Gamma]], \[Sigma]],
v \[Distributed]
StableDistribution[\[Alpha], \[Beta], \[Gamma], \[Sigma]]}]
];
\[ScriptCapitalD] = LogNormalStableDistribution[1.5, 1, 1, 0.5, 1]
Which gives me this:
TransformedDistribution[
1 + \[FormalX]1 \[FormalX]2, {\[FormalX]1 \[Distributed]
LogNormalDistribution[0, 0.5], \[FormalX]2 \[Distributed]
StableDistribution[1, 1.5, 1, 1, 0.5]}]
But when I try to plot a PDF of the distribution it never seems to finish (granted I haven't let it run more than a minute or 2):
Plot[PDF[\[ScriptCapitalD], x], {x, -4, 6}] (* This should plot over the same range as the Histogram above *)
So, some questions:
Does my function: LogNormalStableDistribution[] make sense to do this kind of thing?
If yes do I:
- Just need to let the Plot[] run longer?
- Change it somehow?
- What can I do to make it run faster?
If not:
- Do I need to approach this in a different way?
- Use MixtureDistribution?
- Use Something else?
Any ideas appreciated.
Best,
J