You are on page 1of 3

Transforming densities: Jacobeans

Consider the lognormal distribution. Change variables in the normal:

pdf ( X = x) = dnorm(x) = s -1 (2p )-1/2 exp(-(x- m )2 / 2s 2 )


with
u= exp(x) .
If you just substitute, you get the wrong expression; it will not integrate to 1. Instead,
note that probability must be preserved in each local interval (x, x+dx) in one
variable, and (u, u+du) in the other.
fX (x)dx= fU (u)du
dx
fU (u) = fX (x)
du

du x
=e =u is called the “Jacobean”. And
dx
dx æ duö
= 1/ ç ÷ = u-1
du è dxø
So,
pdf (U = u) = (u)-1 ´ s -1 (2p )-1/2 exp(-(log(u) - m )2 / 2s 2 ) .

The higher dimensional version:

For CONTINUOUS distributions, the key principle for changes-of-variables is:

a) probability = density x area

b) transformations must preserve probability


Probability must be preserved, therefore a mnemonic:

Probability = Probability

Area ×Density = Area ×Density

-1-
f X ,Y ( x, y )dxdy = fU ,V (u , v )dudv
dxdy
f X ,Y ( x, y ) “ ” = fU ,V (u , v )
dudv
f X ,Y ( x, y ) | det J -1 |= fU ,V (u, v)
f X ,Y ( x, y ) | det J |-1 = fU ,V (u, v)

The Jacobian matrix holds the partial derivatives:


��U �
U �
��X �Y �
J =� �
��V �V �
� �
��X �Y �
The determinant (abs value) |J| is the ratio of the volume elements.

J = ratio of areas = the Jacobean of the transformation x = zu, y = z (1 - u ) , is

��x/� z � y/�z� �u 1- u �
J (( z, u ) � ( x, y )) = det � �= det � �
��
x/� u � y/�u� �z - z �
= -uz - (1 - u ) z = -z = z

�x �x
dx = dz + du = udz + zdu
�z �
u
�y �y
dy = dz + du = (1 - u )dz + zdu
�z �
u


z �
z du
dz = dx + dy = dx + dy

x �
y dz dy
u du y
�u �u y dx
du = dx + dy = ( dx - dy )
�x �y ( x + y )2 dz
x

Exercises:

-2-
1. In this example, check that the Jacobean of the transformation (where “inverse” means function
that goes backwards) equals the inverse of the Jacobean of the inverse transformation . Note two
different uses of the work inverse.

1
J (( z , u ) � ( x, y )) =
J (( x, y ) � ( z, u ))

2. What is the Jacobean of the transformation y = exp( x) ? From this, what is the density of the
lognormal distribution [y]? Check that the integral equals 1, by numerical integration, using the R
function integrate().

Example: Beta and Gamma distribution

-3-

You might also like