distributions.chisq¶
Module: distributions.chisq
¶
Functions¶
-
selectinf.distributions.chisq.
quadratic_bounds
(y, operator, affine_constraints)[source]¶ Given a set specified by an affine constraint
\[C = \{z \in \mathbb{R}^q: Az \leq b \}\]and \(A_{p \times q}\) given by operator, this function determines the slice
\[\{t: A(y + t \eta) \leq b\}\]where
\[\eta = \frac{A^TAy}{\|A^TAy\|_2}\]This is used to create a truncated \(\chi\) test, as described for the group LASSO in `Kac Rice`_ and implemented in the function quadratic_test.
- Parameters
y : np.float((q,))
operator : np.float((p,q))
affine_constraints : `selection.constraints.constraints`_
- Returns
lower_bound : float
observed : float
upper_bound : float
sd : float
Notes
The test is based on the fact that, conditional on \(\eta\) and the constraints, \(Ay\) is a truncated \(\chi\) random variable.
-
selectinf.distributions.chisq.
quadratic_test
(y, operator, affine_constraints)[source]¶ Test the null hypothesis $$H_0:A_{p times q}mu_{q times 1} = 0$$ based on \(y \sim N(\mu,\Sigma)\) with \(\Sigma\) given by affine_constraints.covariance where affine_constraints represents the set
\[C = \{z \in \mathbb{R}^q: Az \leq b \}\]- Parameters
y : np.float((q,))
operator : np.float((p,q))
affine_constraints : `selection.constraints.constraints`_
- Returns
lower_bound : float
-
selectinf.distributions.chisq.
tangent_space
(operator, y)[source]¶ Return the unit vector \(\eta(y)=Ay/\|Ay\|_2\) where \(A\) is operator. It also forms a basis for the tangent space of the unit sphere at \(\eta(y)\).
- Parameters
operator : np.float((p,q))
y : np.float((q,)
- Returns
eta : np.float(p)
Unit vector that achieves the norm of \(Ay\) with \(A\) as operator.
tangent_space : np.float((p-1,p))
An array whose rows form a basis for the tangent space of the sphere at eta.
Notes
Implicitly assumes \(A\) is of rank p and any (p-1) rows of the identity can be used to find a basis of the tangent space after projection off of \(Ay\).