class_docstr: Censored distribution
  
  The pdf of a censored distribution is
  
  .. math::
  
      \begin{cases}
          0 & \text{for } x < lower, \\
          \text{CDF}(lower, dist) & \text{for } x = lower, \\
          \text{PDF}(x, dist) & \text{for } lower < x < upper, \\
          1-\text{CDF}(upper, dist) & \text {for} x = upper, \\
          0 & \text{for } x > upper,
      \end{cases}
  
  
  Parameters
  ----------
  dist : unnamed_distribution
      Univariate distribution which will be censored.
      This distribution must have a logcdf method implemented for sampling.
  
      .. warning:: dist will be cloned, rendering it independent of the one passed as input.
  
  lower : float or None
      Lower (left) censoring point. If `None` the distribution will not be left censored
  upper : float or None
      Upper (right) censoring point. If `None`, the distribution will not be right censored.
  
  Warnings
  --------
  Continuous censored distributions should only be used as likelihoods.
  Continuous censored distributions are a form of discrete-continuous mixture
  and as such cannot be sampled properly without a custom step sampler.
  If you wish to sample such a distribution, you can add the latent uncensored
  distribution to the model and then wrap it in a :class:`~pymc.Deterministic`
  :func:`~pymc.math.clip`.
  
  
  Examples
  --------
  .. code-block:: python
  
      with pm.Model():
          normal_dist = pm.Normal.dist(mu=0.0, sigma=1.0)
          censored_normal = pm.Censored("censored_normal", normal_dist, lower=-1, upper=1)
class_docstr_tok: ["Censored","distribution","The","pdf","of","a","censored","distribution","is","..","math",":",":","\\begin","{","cases","}","0","&","\\text","{","for","}","x","<","lower",",","\\\\","\\text","{","CDF","}","(","lower",",","dist",")","&","\\text","{","for","}","x","=","lower",",","\\\\","\\text","{","PDF","}","(","x",",","dist",")","&","\\text","{","for","}","lower","<","x","<","upper",",","\\\\","1-\\text","{","CDF","}","(","upper",",","dist",")","&","\\text","{","for","}","x","=","upper",",","\\\\","0","&","\\text","{","for","}","x",">","upper",",","\\end","{","cases","}","Parameters","--","--","--","--","--","dist",":","unnamed_distribution","Univariate","distribution","which","will","be","censored",".","This","distribution","must","have","a","logcdf","method","implemented","for","sampling",".","..","warning",":",":","dist","will","be","cloned",",","rendering","it","independent","of","the","one","passed","as","input",".","lower",":","float","or","None","Lower","(","left",")","censoring","point",".","If","`","None","`","the","distribution","will","not","be","left","censored","upper",":","float","or","None","Upper","(","right",")","censoring","point",".","If","`","None","`",",","the","distribution","will","not","be","right","censored",".","Warnings","--","--","--","--","Continuous","censored","distributions","should","only","be","used","as","likelihoods",".","Continuous","censored","distributions","are","a","form","of","discrete-continuous","mixture","and","as","such","can","not","be","sampled","properly","without","a","custom","step","sampler",".","If","you","wish","to","sample","such","a","distribution",",","you","can","add","the","latent","uncensored","distribution","to","the","model","and","then","wrap","it","in","a",":","class",":","`","~pymc.Deterministic","`",":","func",":","`","~pymc.math.clip","`",".","Examples","--","--","--","--","..","code-block",":",":","python","with","pm.Model","(",")",":","normal_dist","=","pm.Normal.dist","(","mu=0.0",",","sigma=1.0",")","censored_normal","=","pm.Censored","(","``","censored_normal","''",",","normal_dist",",","lower=-1",",","upper=1",")"]
code: def dist(cls, dist, lower, upper, **kwargs):
      if not isinstance(dist, TensorVariable) or not isinstance(
          dist.owner.op, (RandomVariable, SymbolicRandomVariable)
      ):
          raise ValueError(
              f"Censoring dist must be a distribution created via the `.dist()` API, got {type(dist)}"
          )
      if dist.owner.op.ndim_supp > 0:
          raise NotImplementedError(
              "Censoring of multivariate distributions has not been implemented yet"
          )
      check_dist_not_registered(dist)
      return super().dist([dist, lower, upper], **kwargs)
  
file_path: pymc/pymc/distributions/censored.py
imports: import numpy
  import pytensor.tensor
  from pytensor.tensor import TensorVariable
  from pytensor.tensor.random.op import RandomVariable
  from pymc.distributions.distribution import Distribution, SymbolicRandomVariable, _moment
  from pymc.distributions.shape_utils import _change_dist_size, change_dist_size
  from pymc.util import check_dist_not_registered
label_desc: Use image node_id 1 for calling the Censored obj's underlying member method code with example usage: obj.dist(cls, dist, lower, upper) and returns: super