<div dir="ltr">Hi, Tony, and thanks Dirk and JL.<div><br></div><div>The answer is that before alias templates (<a href="http://en.cppreference.com/w/cpp/language/type_alias">http://en.cppreference.com/w/cpp/language/type_alias</a>) each distribution needed its own class definition and header file.  There was basically a large amount of overhead in maintaining each distribution.</div>
<div><br></div><div>When the package was changing rapidly, I had to refactor those classes several times, so it made sense to focus on the design a bit more and get it stable before I built out all the distribution classes.</div>
<div><br></div><div>Now that we can use alias templates, it is trivial to add more distributions.  See the examples here:</div><div><a href="https://github.com/armstrtw/CppBugs/blob/master/cppbugs/mcmc.distributions.hpp">https://github.com/armstrtw/CppBugs/blob/master/cppbugs/mcmc.distributions.hpp</a><br>
</div><div><br></div><div>For instance, now a normal distribution node is declared this way (where the 2p means 2 parameters):</div><div>template <class T,class U,class V> using Normal = Stochastic2p<T,U,V,normal_logp>;<br>
</div><div><br></div><div>So, the only thing you really need to supply is the logp function.  If you want to point me to weibull, I can add it pretty easily.  Or write one and send it to me.  It needs to be templated, like so:<br>
</div><div><div>template<typename T, typename U, typename V></div><div>  double normal_logp(const T& x, const U& mu, const V& tau) {</div><div>    return arma::accu(0.5*log_approx(0.5*tau/arma::math::pi()) - 0.5 * arma::schur(tau, square(x - mu)));</div>
<div>  }</div></div><div><br></div><div>If I don't like the wikipedia version, I often consult the pymc documentation (those guys have done a great job):</div><div><a href="http://pymc-devs.github.io/pymc/distributions.html#continuous-distributions">http://pymc-devs.github.io/pymc/distributions.html#continuous-distributions</a><br>
</div><div><br></div><div>-Whit</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Aug 11, 2014 at 2:07 PM, Dirk Eddelbuettel <span dir="ltr"><<a href="mailto:edd@debian.org" target="_blank">edd@debian.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Tony,<br>
<div class=""><br>
On 11 August 2014 at 12:18, tony nwankwo wrote:<br>
| I must express gratitude to those that built this package.<br>
| I work in the oil & gas industry and a lot of what we do in Drilling follows Weibull, Lognormal distributions. Any particular reason these are not included in the cppbugs / rcppbugs ?<br>
<br>
</div>You may get a quicker reply if you ask Whit directly. I'll add him as a CC.<br>
<span class="HOEnZb"><font color="#888888"><br>
Dirk<br>
<br>
--<br>
<a href="http://dirk.eddelbuettel.com" target="_blank">http://dirk.eddelbuettel.com</a> | @eddelbuettel | <a href="mailto:edd@debian.org">edd@debian.org</a><br>
</font></span></blockquote></div><br></div>