Skip to content

Commit 59bab28

Browse files
committed
Update lambertw.md
updated expectations for MLE vs moment-matching. Fixed some typos.
1 parent 18b0816 commit 59bab28

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

gsoc_proposals/2021/lambertw.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,27 +26,35 @@ test_normality(out$input) # Gaussianized a Cauchy!
2626

2727
![](https://aws1.discourse-cdn.com/standard14/uploads/mc_stan/original/2X/6/6f039d1b23ce1ed4d75036bce63e374b0cb4cfdf.png)
2828

29-
Lambert-W transforms can be estimated by either maximum likelihood estimation or moment matching and discussion is ongoing as to which will be better for the Stan language.
29+
Lambert-W transforms can be estimated by either maximum likelihood estimation or moment matching and discussion is ongoing as to which will be better for the Stan language. Ideally the student would implement both, compare the outcomes and code complexity, and provide recommendations on when each approach is suitable.
3030

31-
The issue with the maximum likelhood approach is that one must specify the original distribution to transform to. This can be nice from an efficiency standpoint but then will need specializations for many of the distributions. The second way of estimating the distribution is by moment matching. In fact, TF does this with their [`gaussianize`](https://www.tensorflow.org/tfx/transform/api_docs/python/tft/scale_to_gaussian) function. TF bases their code on the [Characterizing Tukey h and hh-Distributions through L-Moments and the L-Correlation](https://opensiuc.lib.siu.edu/cgi/viewcontent.cgi?article=1005&context=epse_pubs) by Headrick and Pant. The TF code uses [binary search](https://github.com/tensorflow/transform/blob/879f2345dcd6096104ae66027feacb099e228e66/tensorflow_transform/gaussianization.py) to numerically solve for the left and right parameters when the distribution is asymmetric.
31+
The maximum likelihood approach can directly be ported to the Stan language to utilize MCMC methods instead of MLE. The issue with this approach is that one must specify the original distribution in which the transformation applies and each distribution will need its own specialization. The upside, however, is that this is the most efficient - in terms of parameter accuracy.
3232

33-
With the L-moments method it is possible to write a tukey_symmetric_lpdf and tukey_skew_lpdf that Stan samples from on the normal 0,1 scale. Along with estimating the location and scale, the symmetric versions would take in `h` and the skew versions an `h_l` and `h_r` as parameters. What is really cool though - and something TF does not do - is that we could do a multi_tukey specification. Where each marginal density has their own skew and/or kurtosis and connected via a correlation matrix. See equation 4.1 in the paper that uses the choleksy factor of the correlation matrix values.
33+
The second way of estimating the distribution is by moment matching. In fact, TF does this with their [`gaussianize`](https://www.tensorflow.org/tfx/transform/api_docs/python/tft/scale_to_gaussian) function. TF bases their code on the [Characterizing Tukey h and hh-Distributions through L-Moments and the L-Correlation](https://opensiuc.lib.siu.edu/cgi/viewcontent.cgi?article=1005&context=epse_pubs) by Headrick and Pant. The TF code uses [binary search](https://github.com/tensorflow/transform/blob/879f2345dcd6096104ae66027feacb099e228e66/tensorflow_transform/gaussianization.py) to numerically solve for the left and right parameters when the distribution is asymmetric.
34+
35+
With the L-moments method it is possible to write a tukey_symmetric_lpdf and tukey_skew_lpdf that Stan samples from on the normal 0,1 scale. Along with estimating the location and scale, the symmetric versions would take in `h` and the skew versions an `h_l` and `h_r` as parameters. An ambitious student can also implement the multivariate version - something TF does not currently do - by a multi_tukey specification. Each marginal density would contain its own skew and/or kurtosis, connected via a correlation matrix. See equation 4.1 in the paper that uses the Cholesky factor of the correlation matrix values.
3436

3537
### Expected Results and Milestones
3638

3739
By the end of the project users will be able to utilize Lambert-W distributions inside of their Stan models.
3840

3941
#### Milestone 1
4042

41-
Implement Lambert-W transforms directly as a function written in the Stan language along with data generating processes. Then use both of these to perform [Simulation Based Calibration](https://mc-stan.org/docs/2_23/stan-users-guide/simulation-based-calibration.html) to verify the correctness of the model.
43+
Implement the MLE version of Lambert-W transforms directly as a function written in the Stan language along with data generating processes. Then use both of these to perform [Simulation Based Calibration](https://mc-stan.org/docs/2_23/stan-users-guide/simulation-based-calibration.html) to verify the correctness of the model.
4244

4345
#### Milestone 2
4446

45-
Work with Stan developers to make a prototype of Lambert-W transforms in C++.
47+
1. Work with Stan developers to make a prototype of the MLE version of the Lambert-W transforms in C++.
48+
2. In parallel, begin work on the moment-matching estimator in the Stan language.
4649

4750
#### Milestone 3
4851

49-
Add this prototype to the [Stan Math library](https://github.com/stan-dev/math).
52+
1. Add the MLE prototype to the [Stan Math library](https://github.com/stan-dev/math).
53+
2. Compare the moment-matching estimator to the model(s) and SBC implemented in milestone 1.
54+
55+
#### Extra Credit
56+
1. Implementation of the moment-matching code in C++.
57+
2. Super extra credit. Add the multivariate extension.
5058

5159
### Helpful Prerequisite Experience
5260

0 commit comments

Comments
 (0)