MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

TransformedDistribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116874] TransformedDistribution
  • From: Jagra <jagra24891 at mypacks.net>
  • Date: Thu, 3 Mar 2011 05:56:52 -0500 (EST)

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 10 minutes so far):

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


  • Prev by Date: Re: Filtering data from numerical minimization
  • Next by Date: Re: Vector Runge-Kutta ODE solver with compilation?
  • Previous by thread: Re: plot error messages are completelly missing
  • Next by thread: Re: TransformedDistribution