# Bilateral Laplace Transform in Mathematica (to be used with Moment Generating Functions)?

I am trying to solve a linear ODE for a Kolmogorov forward equation to get a stationary distribution of a random variable. The easiest approach may be to transform the ODE with a two-sided Laplace transform and then solve for the equation, which would be the moment-generating function. BUT: I can't figure out how to do a two-sided Laplace transform.

To give the concrete test for what I am looking for:

MomentGeneratingFunction[NormalDistribution[μ, σ], t]


Properly spits out $e^{\frac{\sigma ^2 t^2}{2}+\mu t}$. But LaplaceTransform defaults to the one-sided transform Laplace transform). If I can figure out the options to make these match, then I can solve my ODE. Also, note that I will need to do the Two-sided Laplace transform of $-t$ instead of just $t$. To see the connection of MGF and Laplace Transforms: http://en.wikipedia.org/wiki/Moment-generating_function#Calculation

I found some old documentation for an obsolete package, http://reference.wolfram.com/legacy/applications/signals/MathematicalTransforms.html, that used to do this with the TransformDirection option, but it doesn't work any more.

-

There are several issues here with the way you are proceeding:

FIRST, if $X$ is a random variable with pdf $f(x)$, then the moment generating function (mgf) is defined as:

$$E[e^{t X}] = \int_{-\infty }^{\infty } e^{t x} f(x) \, dx$$

where the expectation is carried out over the full domain of support, which for a Normal distributed random variable ... is the real line.

The LaplaceTransform, by contrast, is defined on the positive real line, and with $t = -s$, namely:

$$\int_{0}^{\infty } e^{-s x} f(x) \, dx$$

So, if you want these two different things to match, then (a) you will need to choose a distribution defined on the positive real line such as the Exponential, and (b), you will need to make the substitution $t = -t$ in the LaplaceTransform function syntax. So for example, this works:

MomentGeneratingFunction[ExponentialDistribution[1], t]


1/(1 - t)

and matches with:

LaplaceTransform[ PDF[ExponentialDistribution[1], x], x, -t]


1/(1 - t)

SECOND, the question arises as to why you want to use LaplaceTransform at all, when you can compute (i) the expectation directly yourself using Integrate or similar function, and (ii) in any case, if you want an inbuilt function to do this, then the more appropriate function to use is FourierTransform to derive the characteristic function (cf), and then use the latter as a function to generate moments from. As per:

 FourierTransform[PDF[NormalDistribution[\[Mu], \[Sigma]], x], x, t, FourierParameters -> {1, 1}]


Finally, using the black box notation PDF[NormalDistribution[ blah ] is asking for trouble ... This is because for most distributions, there are any number of common competing functional forms or parameterisations, and a much safer approach is to explicitly work with the pdf that you want as, say:

f = blah;


... so that you know exactly what you are working with.

-
You are right, I did forget a negative sign. You are right that I need the laplace transform over the whole domain, which is why I need the bilateral (or two-sided) laplace transform, hence the title of my question. en.wikipedia.org/wiki/Moment-generating_function#Calculation to see the connection to laplace transforms. –  jlperla May 13 '14 at 16:12

Not a complete answer. According to the wikipedia of two-sided Laplace transform, the relationship between two-sided Laplace transform and one-sided Laplace transform is:

$$\mathcal{B}\{f(t)\}(s) = \mathcal{L}\{f(t)\}(s) + \mathcal{L}\{f(-t)\}(-s)$$

If I understand the above formula correctly, it can be implemented as the following:

BilateralLaplaceTransform[f_, t_, s_] :=
LaplaceTransform[f[t], t, s] + LaplaceTransform[f[-t], t, -s]


Notice that here f should be a functional relationship e.g. a pure function. It does handle your specific example:

f = PDF@NormalDistribution[μ, σ]
FullSimplify[BilateralLaplaceTransform[f, o, -t], σ > 0]

E^(1/2 t (2 μ + t σ^2))


But the troublesome part is, you mentioned that you want to solve a ODE i.e. you want to make use of the differentiation property of the transform, but currently my BilateralLaplaceTransform can not handle it properly：

BilateralLaplaceTransform[g', t, s]

-2 g[0] - s LaplaceTransform[g[-t], t, -s] + s LaplaceTransform[g[t], t, s]


The result is even incorrect, I'm not sure.

BTW, if you're just trying to solve a ODE from $-\infty$ to $+\infty$, you may want to read this and this post about Fourier transform.

-
Thank you for the notes and links. sounds like I am better off sticking with the characteristic function for these sorts of ODEs (and I appreciate the links on the bugs). I like the laplace transforms to avoid my potential algebra mistakes in complex space, but if Mathematica can't handle it two sided, then so be it. –  jlperla Apr 29 at 17:43