Lo 2012 reports an approximation for the difference of two random variables by a shifted lognormal distribution.
Rather than approximating the density of \(y = a - b\), it approximates the density of \(y_s = a - b + s\), where \(s\) is the shift. Hence, one has to subtract \(s\) from provided mean and quantiles. One can can use the variance, and relative error but has to recompute the relative error.
The probability of the zero quantile needs to be larger than a significance level. We can compute it based on the lognormal approximation.
Since Lo12 is only accurate if the expected difference is small compared to the expected sum, the probability of the difference being larger than zero can be estimated by a sampling both terms.
## Warning in estimateDiffLognormal(mu1, mu2, sigma1, sigma2, corr = -0.8): ## Expected S0+/S0- << 1 but this ratio was 0.34219239671082. The Lo 2012 ## approximation becomes inaccurate for small numbers a and b.
## Loading required namespace: mvtnorm
## pLo pSample ## 0.04540137 0.03549000
In the example both approaches give a probability of less than 5% so that we conclude that the difference is significant.
The method of Lo12 requires \(\sigma_b < \sigma_a\) and otherwise gives an error.
## Error in estimateDiffLognormal(mu1, mu2, sigma1, sigma2, 0) : ## expected sigma_a > sigma_b but got 0.15 <= 0.25. Exchange the terms and negate the resulting quantiles (see vignette('lognormalDiff').
But one can compute the density of \(y_r = -y = b - a\) and plot the density of the shifted and negated distribution.
## mu sigma shift ## 6.10147970 0.06859943 455.64000921
## mean ## 8.070146
Because we subtract a large-variance lognormal variable, the distribution becomes right-skewed.