# multivariate lognormal distribution in mathematica

Is the LogMultinormalDistribution function really the multivariate lognormal distribution? Because I get different results with the same parameters in R

I want to compute the pdf of the bivariate lognormal distribution $\mathcal{LN}(\bigl(\begin{smallmatrix} 0.5\\ -2 \end{smallmatrix} \bigr), \bigl(\begin{smallmatrix} 0.3&0\\ 0&0.3 \end{smallmatrix} \bigr)$)

at the point $\bigl(\begin{smallmatrix} 1\\ 0.1 \end{smallmatrix} \bigr)$.

in R:

MyVar <- matrix(c(0.3,0,0,0.3),byrow=TRUE,nrow=2)
MyMean <- c(0.5,-2)
dlnorm.rplus(c(1,0.1),meanlog=MyMean,varlog=MyVar) # from package compositions
> [1] 7.525946


In Mathematica:

PDF[LogMultinormalDistribution[{0.5, -2}, {{0.3, 0}, {0, 0.3}}], {1,0.1}]
> 3.00242


what is the deal here?

• For the benefit of people who don't know R, can you also define mathematically the quantity you're trying to compute?
– user484
Dec 12, 2014 at 13:48
• @Rahul I want to compute the pdf of a bivariate lognormal distribution at a given point. I think this is pretty obvious. Dec 12, 2014 at 14:11
• But you have failed to specify the functional form of the pdf as (a) intended by yourself, (b) as implemented in R, and (c) implemented in Mma. How are we to know that (a), (b) and (c) happen to be all the same? Dec 12, 2014 at 14:13
• @wolfies I added the formal definition of what I want. I'm not sure which one of the results is correct, but I trust the mathematica one more. There should be only one lognormal distribution, I think there's no disambiguation. The documentation of the R package didn't help me. It would be interesting what other computer algebra systems say, but I don't have any. Dec 12, 2014 at 14:32
• Well, no ... there is not just one parameterisation of the Lognormal distribution. There is not even 1 notation for the 'Normal distribution': most define it as $N(\mu, \sigma^2)$; but some people use $N(\mu, \sigma)$. Your question is undefined ... you need to link your multiLognormal to a parent multivariate Normal (which you will need to define), or specify the pdf of your desired multi-Lognormal yourself. Dec 12, 2014 at 14:56

Let $Z \sim N(\mu,s^2)$. By definition, $X = e^Z$ has a Lognormal distribution with pdf $f(x)$:

f[x_, mu_, s_] = (1/(x s Sqrt[2 Pi]))*Exp[-((Log[x] - mu)^2/(2 s^2))];


In your case, the variance-covariance matrix has zero correlation, so (given Normality) your two variables are in fact independent. Thus, the joint pdf of two Lognormals is just the product of the individual pdf's, and thus your desired joint bivariate Lognormal density is:

f[1, 1/2, Sqrt[0.3]] * f[.1, -2, Sqrt[0.3]]


3.00242

which is exactly what Mathematica returns to:

PDF[LogMultinormalDistribution[{0.5, -2}, {{0.3, 0}, {0, 0.3}}], {1,0.1}]


Hence, Mathematica is performing correctly. You now need to check the definition of whatever R is doing (or try an R user group).

• thanks, this is really helping me. I should have thought about the fact that I can compute the product. In R I get the same > dlnorm(1,0.5,sqrt(0.3))*dlnorm(.1,-2,sqrt(0.3)) [1] 3.002418  Dec 12, 2014 at 16:29