class_docstr: This is a PolyaGamma(1, 0) distribution truncated to have finite support in
  the interval (0, 2.5). See [1] for details. As a consequence of the truncation
  the `log_prob` method is only accurate to about six decimal places. In
  addition the provided sampler is a rough approximation that is only meant to
  be used in contexts where sample accuracy is not important (e.g. in initialization).
  Broadly, this implementation is only intended for usage in cases where good
  approximations of the `log_prob` are sufficient, as is the case e.g. in HMC.
  
  :param tensor prototype: A prototype tensor of arbitrary shape used to determine
      the `dtype` and `device` returned by `sample` and `log_prob`.
  
  References
  
  [1] 'Bayesian inference for logistic models using Polya-Gamma latent variables'
      Nicholas G. Polson, James G. Scott, Jesse Windle.
class_docstr_tok: ["This","is","a","PolyaGamma","(","1",",","0",")","distribution","truncated","to","have","finite","support","in","the","interval","(","0",",","2.5",")",".","See","[","1","]","for","details",".","As","a","consequence","of","the","truncation","the","`","log_prob","`","method","is","only","accurate","to","about","six","decimal","places",".","In","addition","the","provided","sampler","is","a","rough","approximation","that","is","only","meant","to","be","used","in","contexts","where","sample","accuracy","is","not","important","(","e.g",".","in","initialization",")",".","Broadly",",","this","implementation","is","only","intended","for","usage","in","cases","where","good","approximations","of","the","`","log_prob","`","are","sufficient",",","as","is","the","case","e.g",".","in","HMC",".",":","param","tensor","prototype",":","A","prototype","tensor","of","arbitrary","shape","used","to","determine","the","`","dtype","`","and","`","device","`","returned","by","`","sample","`","and","`","log_prob","`",".","References","[","1","]","'Bayesian","inference","for","logistic","models","using","Polya-Gamma","latent","variables'","Nicholas","G.","Polson",",","James","G.","Scott",",","Jesse","Windle","."]
code: def __init__(self, prototype, validate_args=None):
      self.prototype = prototype
      super(TruncatedPolyaGamma, self).__init__(
          batch_shape=(), event_shape=(), validate_args=validate_args
      )
  
file_path: pyro/pyro/distributions/polya_gamma.py
imports: import math
  import torch
  from torch.distributions import constraints
  from pyro.distributions.torch import Exponential
  from pyro.distributions.torch_distribution import TorchDistribution
label_desc: Use image node_id 1 to create a new TruncatedPolyaGamma object from inherited base classes: TorchDistribution with example: obj = TruncatedPolyaGamma(prototype, validate_args)