randomized.screening

Module: randomized.screening

Inheritance diagram for selectinf.randomized.screening:

digraph inheritancebb7809c6ac { rankdir=LR; size="8.0, 12.0"; "randomized.query.gaussian_query" [URL="selectinf.randomized.query.html#selectinf.randomized.query.gaussian_query",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "randomized.query.query" -> "randomized.query.gaussian_query" [arrowsize=0.5,style="setlinewidth(0.5)"]; "randomized.query.query" [URL="selectinf.randomized.query.html#selectinf.randomized.query.query",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top",tooltip="This class is the base of randomized selective inference"]; "randomized.screening.marginal_screening" [URL="#selectinf.randomized.screening.marginal_screening",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "randomized.screening.screening" -> "randomized.screening.marginal_screening" [arrowsize=0.5,style="setlinewidth(0.5)"]; "randomized.screening.screening" [URL="#selectinf.randomized.screening.screening",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "randomized.query.gaussian_query" -> "randomized.screening.screening" [arrowsize=0.5,style="setlinewidth(0.5)"]; "randomized.screening.stepup" [URL="#selectinf.randomized.screening.stepup",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "randomized.screening.screening" -> "randomized.screening.stepup" [arrowsize=0.5,style="setlinewidth(0.5)"]; "randomized.screening.topK" [URL="#selectinf.randomized.screening.topK",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5)",target="_top"]; "randomized.screening.screening" -> "randomized.screening.topK" [arrowsize=0.5,style="setlinewidth(0.5)"]; }

Classes

marginal_screening

class selectinf.randomized.screening.marginal_screening(observed_data, covariance, randomizer, threshold, perturb=None)[source]

Bases: selectinf.randomized.screening.screening

__init__(observed_data, covariance, randomizer, threshold, perturb=None)[source]
Parameters

randomization : selection.randomized.randomization.randomization

Instance of a randomization scheme. Describes the law of \(\omega\).

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

fit(perturb=None)[source]
static type1(observed_data, covariance, marginal_level, randomizer_scale, perturb=None)[source]

Threshold

full_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

get_sampler()
marginal_targets(features)

Entries of the mean of Z_E

multivariate_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

randomize(perturb=None)

The actual randomization step.

Parameters

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

property sampler

Sampler of optimization (augmented) variables.

selective_MLE(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})
Parameters

observed_target : ndarray

Observed estimate of target.

target_cov : ndarray

Estimated covaraince of target.

target_score_cov : ndarray

Estimated covariance of target and score of randomized query.

level : float, optional

Confidence level.

solve_args : dict, optional

Arguments passed to solver.

set_sampler(sampler)
setup_sampler()

Setup query to prepare for sampling. Should set a few key attributes:

  • observed_score_state

  • observed_opt_state

  • opt_transform

solve()
summary(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)

Produce p-values and confidence intervals for targets of model including selected features

Parameters

target : one of [‘selected’, ‘full’]

features : np.bool

Binary encoding of which features to use in final model and targets.

parameter : np.array

Hypothesized value for parameter – defaults to 0.

level : float

Confidence level.

ndraw : int (optional)

Defaults to 1000.

burnin : int (optional)

Defaults to 1000.

compute_intervals : bool

Compute confidence intervals?

dispersion : float (optional)

Use a known value for dispersion, or Pearson’s X^2?

useC = True

screening

class selectinf.randomized.screening.screening(observed_data, covariance, randomizer, perturb=None)[source]

Bases: selectinf.randomized.query.gaussian_query

__init__(observed_data, covariance, randomizer, perturb=None)[source]
Parameters

randomization : selection.randomized.randomization.randomization

Instance of a randomization scheme. Describes the law of \(\omega\).

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

fit(perturb=None)[source]
multivariate_targets(features, dispersion=1.0)[source]

Entries of the mean of Sigma[E,E]^{-1}Z_E

full_targets(features, dispersion=1.0)[source]

Entries of the mean of Sigma[E,E]^{-1}Z_E

marginal_targets(features)[source]

Entries of the mean of Z_E

get_sampler()
randomize(perturb=None)

The actual randomization step.

Parameters

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

property sampler

Sampler of optimization (augmented) variables.

selective_MLE(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})
Parameters

observed_target : ndarray

Observed estimate of target.

target_cov : ndarray

Estimated covaraince of target.

target_score_cov : ndarray

Estimated covariance of target and score of randomized query.

level : float, optional

Confidence level.

solve_args : dict, optional

Arguments passed to solver.

set_sampler(sampler)
setup_sampler()

Setup query to prepare for sampling. Should set a few key attributes:

  • observed_score_state

  • observed_opt_state

  • opt_transform

solve()
summary(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)

Produce p-values and confidence intervals for targets of model including selected features

Parameters

target : one of [‘selected’, ‘full’]

features : np.bool

Binary encoding of which features to use in final model and targets.

parameter : np.array

Hypothesized value for parameter – defaults to 0.

level : float

Confidence level.

ndraw : int (optional)

Defaults to 1000.

burnin : int (optional)

Defaults to 1000.

compute_intervals : bool

Compute confidence intervals?

dispersion : float (optional)

Use a known value for dispersion, or Pearson’s X^2?

useC = True

stepup

class selectinf.randomized.screening.stepup(observed_data, covariance, randomizer, stepup_Z, perturb=None)[source]

Bases: selectinf.randomized.screening.screening

__init__(observed_data, covariance, randomizer, stepup_Z, perturb=None)[source]
Parameters

randomization : selection.randomized.randomization.randomization

Instance of a randomization scheme. Describes the law of \(\omega\).

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

fit(perturb=None)[source]
static BH(observed_score, covariance, randomizer_scale, q=0.2, perturb=None)[source]
BH_general(covariance, randomizer_cov, q=0.2, perturb=None)[source]
full_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

get_sampler()
marginal_targets(features)

Entries of the mean of Z_E

multivariate_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

randomize(perturb=None)

The actual randomization step.

Parameters

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

property sampler

Sampler of optimization (augmented) variables.

selective_MLE(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})
Parameters

observed_target : ndarray

Observed estimate of target.

target_cov : ndarray

Estimated covaraince of target.

target_score_cov : ndarray

Estimated covariance of target and score of randomized query.

level : float, optional

Confidence level.

solve_args : dict, optional

Arguments passed to solver.

set_sampler(sampler)
setup_sampler()

Setup query to prepare for sampling. Should set a few key attributes:

  • observed_score_state

  • observed_opt_state

  • opt_transform

solve()
summary(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)

Produce p-values and confidence intervals for targets of model including selected features

Parameters

target : one of [‘selected’, ‘full’]

features : np.bool

Binary encoding of which features to use in final model and targets.

parameter : np.array

Hypothesized value for parameter – defaults to 0.

level : float

Confidence level.

ndraw : int (optional)

Defaults to 1000.

burnin : int (optional)

Defaults to 1000.

compute_intervals : bool

Compute confidence intervals?

dispersion : float (optional)

Use a known value for dispersion, or Pearson’s X^2?

useC = True

topK

class selectinf.randomized.screening.topK(observed_data, covariance, randomizer, K, abs=False, perturb=None)[source]

Bases: selectinf.randomized.screening.screening

__init__(observed_data, covariance, randomizer, K, abs=False, perturb=None)[source]
Parameters

randomization : selection.randomized.randomization.randomization

Instance of a randomization scheme. Describes the law of \(\omega\).

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

fit(perturb=None)[source]
full_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

get_sampler()
marginal_targets(features)

Entries of the mean of Z_E

multivariate_targets(features, dispersion=1.0)

Entries of the mean of Sigma[E,E]^{-1}Z_E

randomize(perturb=None)

The actual randomization step.

Parameters

perturb : ndarray, optional

Value of randomization vector, an instance of \(\omega\).

property sampler

Sampler of optimization (augmented) variables.

selective_MLE(observed_target, target_cov, target_score_cov, level=0.9, solve_args={'tol': 1e-12})
Parameters

observed_target : ndarray

Observed estimate of target.

target_cov : ndarray

Estimated covaraince of target.

target_score_cov : ndarray

Estimated covariance of target and score of randomized query.

level : float, optional

Confidence level.

solve_args : dict, optional

Arguments passed to solver.

set_sampler(sampler)
setup_sampler()

Setup query to prepare for sampling. Should set a few key attributes:

  • observed_score_state

  • observed_opt_state

  • opt_transform

solve()
summary(observed_target, target_cov, target_score_cov, alternatives, opt_sample=None, target_sample=None, parameter=None, level=0.9, ndraw=10000, burnin=2000, compute_intervals=False)

Produce p-values and confidence intervals for targets of model including selected features

Parameters

target : one of [‘selected’, ‘full’]

features : np.bool

Binary encoding of which features to use in final model and targets.

parameter : np.array

Hypothesized value for parameter – defaults to 0.

level : float

Confidence level.

ndraw : int (optional)

Defaults to 1000.

burnin : int (optional)

Defaults to 1000.

compute_intervals : bool

Compute confidence intervals?

dispersion : float (optional)

Use a known value for dispersion, or Pearson’s X^2?

useC = True

Function

selectinf.randomized.screening.stepup_selection(Z_values, stepup_Z)[source]