1
$\begingroup$

Suppose I have a random variable which I suspect is the product of a lognormally distributed random variable $X$ and an independent uniformly distributed variable $U(0, 1)$. (The variables are the total incomes of workers in a calendar year who started on a random day in that year. The logic is that workers' annual salary is lognormal but they start on a random day of the year)

I'm interested in estimating the parameters mu and sigma for the lognormal distribution.

x <- runif(10e3) * rlnorm(10e3, 9, 1)

If we assume $X \sim U(0, 1) \times \mathrm{LogNormal}(\mu, \sigma)$ then my understanding is $$\log(X) \sim -\mathrm{Exp}(1) + N(\mu, \sigma)$$

and that this is an exponentially-modified Gaussian distribution. However, when I estimate the parameters using fitdistr, it seems to systematically underestimate mu or fail to estimate for some other reason (for example trying to estimate beta beyond the bounds).

set.seed(810)
library(MASS)
library(brms)
#> Loading required package: Rcpp
#> Registered S3 method overwritten by 'xts':
#>   method     from
#>   as.zoo.xts zoo
#> Loading 'brms' package (version 2.10.0). Useful instructions
#> can be found by typing help('brms'). A more detailed introduction
#> to the package is available through vignette('brms_overview').
x <- runif(10e3) * rlnorm(10e3, 10, 1)
logx <- log(x)
fitdistr(logx, 
         dexgaussian,
         start = list(mu = 7, 
                      sigma = 1, 
                      beta = 1),
         lower = c(5, 0.9, 1/10e3),
         upper = c(15, 1.1, Inf))
#>        mu         sigma         beta   
#>   9.00146956   1.10000000   0.68489168 
#>  (0.01295792) (0.01039890) (0.02761565)

Created on 2019-10-08 by the reprex package (v0.3.0)

How should I best try to estimate these parameters?

$\endgroup$
1
  • 1
    $\begingroup$ Your title says that you're multiplying distributions but your body text clearly shows you're multiplying random variables. Please make the title and body consistent in their description of the problem. $\endgroup$
    – Glen_b
    Oct 8, 2019 at 11:23

2 Answers 2

2
$\begingroup$

$\log X$ is not ExpGaussian, however $-\log X$ is; it being the sum of an $\text{Exp}(1)$ and a $N(-\mu,\sigma^2)$.

This may be a part of your problem! If you try the estimation on $-\log X$ and then negate the estimate of $\mu$ you might get a better outcome.

$\endgroup$
1
$\begingroup$

I will assume your two random variables are independent (you didn't specify.) Let the $Z=XY$ where $X,Y$ are independent, with $X \sim \mathcal{logNorm}(\mu,\sigma^2)$ and $Y\sim \mathcal{Unif}(0,1)$. We will use mgf's (moment generating functions.) We can find that the density function of $\log Y$ is $f_{\log Y}(z)=e^z,\quad z\le 0$, and its mgf is $$ M_{\log Y}(t)=\frac1{t+1},\quad t>-1. $$ So the mgf of the sum $\log Z=\log X + \log Y$ is $$ M_{\log X}(t)=\frac{e^{\mu t+\frac12 \sigma^2 t^2}}{t+1}\quad\text{for $t>-1$.} $$ This can be used multiple ways for estimation, you can use differentiation to obtain moments from the mgf, which gives equations for the method of moments, or you could calculate an empirical mgf from the data, and estimate by fitting that to the theoretical mgf above. Or you could try to invert the mgf to find the density, thus likelihood function, exactly. Or invert it approximately by the saddlepoint approximation.

I will come back and post some details, if there isn't any better answer first ...

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.