You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.. [1] Zhou, Mingyuan, and Lawrence Carin. 2012. “Augment-and-Conquer Negative Binomial Processes.” Advances in Neural Information Processing Systems 25.
.. [1] Zhou, Mingyuan, Lingbo Li, David Dunson, and Lawrence Carin. 2012. “Lognormal and Gamma Mixed Negative Binomial Regression.” Proceedings of the International Conference on Machine Learning. International Conference on Machine Learning 2012: 1343–50. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4180062/.
r"""Build a Gibbs sampler for the negative binomial regression with a horseshoe prior and gamma prior dispersion.
513
+
514
+
This is a direct extension of `nbinom_horseshoe_gibbs_with_dispersion` that
515
+
adds a gamma prior assumption to the :math:`h` parameter in the
516
+
negative-binomial and samples according to [1]_.
517
+
518
+
In other words, this model is the same as `nbinom_horseshoe_gibbs` except
519
+
for the addition assumption:
520
+
521
+
.. math::
522
+
523
+
\begin{gather*}
524
+
h \sim \operatorname{Gamma}\left(a, b\right)
525
+
\end{gather*}
526
+
527
+
528
+
References
529
+
----------
530
+
.. [1] Zhou, Mingyuan, Lingbo Li, David Dunson, and Lawrence Carin. 2012. “Lognormal and Gamma Mixed Negative Binomial Regression.” Proceedings of the International Conference on Machine Learning. International Conference on Machine Learning 2012: 1343–50. https://www.ncbi.nlm.nih.gov/pmc/articles/PMC4180062/.
531
+
532
+
"""
533
+
534
+
defnbinom_horseshoe_step(
535
+
beta: TensorVariable,
536
+
lmbda: TensorVariable,
537
+
tau: TensorVariable,
538
+
h: TensorVariable,
539
+
y: TensorVariable,
540
+
X: TensorVariable,
541
+
a: TensorVariable,
542
+
b: TensorVariable,
543
+
):
544
+
"""Complete one full update of the Gibbs sampler and return the new state
545
+
of the posterior conditional parameters.
546
+
547
+
Parameters
548
+
----------
549
+
beta
550
+
Coefficients (other than intercept) of the regression model.
551
+
lmbda
552
+
Inverse of the local shrinkage parameter of the horseshoe prior.
553
+
tau
554
+
Inverse of the global shrinkage parameters of the horseshoe prior.
555
+
h
556
+
The "number of successes" parameter of the negative-binomial distribution
557
+
used to model the data.
558
+
y
559
+
The observed count data.
560
+
X
561
+
The covariate matrix.
562
+
a
563
+
The shape parameter for the :math:`h` gamma prior.
0 commit comments