truncated.F

Module: truncated.F

Inheritance diagram for selectinf.truncated.F:

digraph inheritancecad834c6f6 { rankdir=LR; size="8.0, 12.0"; "truncated.F.truncated_F" [URL="#selectinf.truncated.F.truncated_F",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "truncated.base.truncated" -> "truncated.F.truncated_F" [arrowsize=0.5,style="setlinewidth(0.5)"]; "truncated.base.truncated" [URL="selectinf.truncated.base.html#selectinf.truncated.base.truncated",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="A distribution, truncated to a union of intervals"]; }

Class

truncated_F

class selectinf.truncated.F.truncated_F(intervals, d1, d2, scale=1)[source]

Bases: selectinf.truncated.base.truncated

__init__(intervals, d1, d2, scale=1)[source]

Create a new truncated distribution object This method is abstract : it has to be overriden

Parameters

intervals : [(float, float)]

The intervals the distribution is truncated to

cdf(z)

Compute the survival function of the truncated distribution

Parameters

z : float

Minimum bound of the interval

Returns

cdf : float

function The cumulative distribution function of the truncated distribution cdf(z) = P( X < z | X is in intervals )

WARNING : This method only use the sf method

more precise

pdf(z)

Compute the probability distribution funtion of the truncated distribution

Parameters

z : float

Returns

p : float

p(z) such that E[f(X)] = int f(z)p(z)dz

quantile(q, tol=1e-06)
rvs(size=1)

Sample a random variable from the truncated disribution

Parameters

size : int

Number of samples. Default : 1

Returns

X : np.array

array of sample

sf(z)

Compute the survival function of the truncated distribution

Parameters

z : float

Minimum bound of the interval

Returns

sf : float

The survival function of the truncated distribution sf(z) = P( X > z | X is in intervals )

Functions

selectinf.truncated.F.null_f(x)[source]
selectinf.truncated.F.sf_F(d1, d2, scale)[source]