Users should be able to incorporate the fact that their data distribution has been truncated.
Example:
p2 = Trunc(p1, lower=-1, upper=1)
Truncation can occur either by keeping all samples in a certain interval or by throwing them out.
In both cases, the sample space that has been left out needs to be marginalized out in the distribution.
For this, we could use scipy.quad on the top-level pdf, or maybe we can do something more efficient/clever.
Many statistics frameworks will allow you to set limits directly when creating random variates
x1 = variable(lower=-1, upper=1)
where the pdf will then be marginalized over implicitly
This could also be an option here.
Also, we should try to use analytical integrals where possible.
In the 1-dimensional case the cdf() method would need to be defined.
For higher-dimensional distributions we might use a generalization like a box_integral() method.
Users should be able to incorporate the fact that their data distribution has been truncated.
Example:
Truncation can occur either by keeping all samples in a certain interval or by throwing them out.
In both cases, the sample space that has been left out needs to be marginalized out in the distribution.
For this, we could use
scipy.quadon the top-levelpdf, or maybe we can do something more efficient/clever.Many statistics frameworks will allow you to set limits directly when creating random variates
where the pdf will then be marginalized over implicitly
This could also be an option here.
Also, we should try to use analytical integrals where possible.
In the 1-dimensional case the
cdf()method would need to be defined.For higher-dimensional distributions we might use a generalization like a
box_integral()method.