econml.inference.PopulationSummaryResults

class econml.inference.PopulationSummaryResults(pred, pred_stderr, mean_pred_stderr, d_t, d_y, alpha=0.05, value=0, decimals=3, tol=0.001, output_names=None, treatment_names=None)[source]

Bases: object

Population summary results class for inferences.

Parameters:
  • d_t (int or None) – Number of treatments

  • d_y (int) – Number of outputs

  • pred (array_like, shape (m, d_y, d_t) or (m, d_y)) – The prediction of the metric for each sample X[i]. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions should be collapsed (e.g. if both are vectors, then the input of this argument will also be a vector)

  • pred_stderr (array_like, shape (m, d_y, d_t) or (m, d_y)) – The prediction standard error of the metric for each sample X[i]. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions should be collapsed (e.g. if both are vectors, then the input of this argument will also be a vector)

  • mean_pred_stderr (None or array_like or scalar, shape (d_y, d_t) or (d_y,)) – The standard error of the mean point estimate, this is derived from coefficient stderr when final stage is linear model, otherwise it’s None. This is the exact standard error of the mean, which is not conservative.

  • alpha (ffloat in [0, 1], default 0.05) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • value (float, default 0) – The mean value of the metric you’d like to test under null hypothesis.

  • decimals (int, default 3) – Number of decimal places to round each column to.

  • tol (float, default 0.001) – The stopping criterion. The iterations will stop when the outcome is less than tol

  • output_names (list of str, optional) – The names of the outputs

  • treatment_names (list of str, optional) – The names of the treatments

__init__(pred, pred_stderr, mean_pred_stderr, d_t, d_y, alpha=0.05, value=0, decimals=3, tol=0.001, output_names=None, treatment_names=None)[source]

Methods

__init__(pred, pred_stderr, ...[, alpha, ...])

conf_int_mean(*[, alpha])

Get the confidence interval of the mean point estimate of each treatment on each outcome for sample X.

conf_int_point(*[, alpha, tol])

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

percentile_point(*[, alpha])

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

pvalue(*[, value])

Get the p value of the z test of each treatment on each outcome for sample X.

summary([alpha, value, decimals, tol, ...])

Get a summary of this instance's information.

zstat(*[, value])

Get the z statistic of the mean point estimate of each treatment on each outcome for sample X.

Attributes

mean_point

Get the mean of the point estimate of each treatment on each outcome for sample X.

std_point

Get the standard deviation of the point estimate of each treatment on each outcome for sample X.

stderr_mean

Get the standard error of the mean point estimate of each treatment on each outcome for sample X.

stderr_point

Get the standard error of the point estimate of each treatment on each outcome for sample X.

conf_int_mean(*, alpha=None)[source]

Get the confidence interval of the mean point estimate of each treatment on each outcome for sample X.

Parameters:

alpha (float in [0, 1], optional) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

Returns:

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type:

tuple of array, shape (d_y, d_t)

conf_int_point(*, alpha=None, tol=None)[source]

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

Parameters:
  • alpha (float in [0, 1], optional) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • tol (optinal float) – The stopping criterion. The iterations will stop when the outcome is less than tol

Returns:

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type:

tuple of array, shape (d_y, d_t)

percentile_point(*, alpha=None)[source]

Get the confidence interval of the point estimate of each treatment on each outcome for sample X.

Parameters:

alpha (float in [0, 1], default 0.05) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

Returns:

lower, upper – The lower and the upper bounds of the confidence interval for each quantity. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will also be a vector)

Return type:

tuple of array, shape (d_y, d_t)

pvalue(*, value=None)[source]

Get the p value of the z test of each treatment on each outcome for sample X.

Parameters:

value (float, optional) – The mean value of the metric you’d like to test under null hypothesis.

Returns:

pvalue – The p value of the z test of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)

summary(alpha=None, value=None, decimals=None, tol=None, output_names=None, treatment_names=None)[source]

Get a summary of this instance’s information.

Parameters:
  • alpha (float in [0, 1], optional) – The overall level of confidence of the reported interval. The alpha/2, 1-alpha/2 confidence interval is reported.

  • value (float, optional) – The mean value of the metric you’d like to test under null hypothesis.

  • decimals (int, optional) – Number of decimal places to round each column to.

  • tol (float, optional) – The stopping criterion. The iterations will stop when the outcome is less than tol

  • output_names (list of str, optional) – The names of the outputs

  • treatment_names (list of str, optional) – The names of the treatments

Returns:

smry – this holds the summary tables and text, which can be printed or converted to various output formats.

Return type:

Summary instance

zstat(*, value=None)[source]

Get the z statistic of the mean point estimate of each treatment on each outcome for sample X.

Parameters:

value (float, optional) – The mean value of the metric you’d like to test under null hypothesis.

Returns:

zstat – The z statistic of the mean point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)

property mean_point

Get the mean of the point estimate of each treatment on each outcome for sample X.

Returns:

mean_point – The point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)

property std_point

Get the standard deviation of the point estimate of each treatment on each outcome for sample X.

Returns:

std_point – The standard deviation of the point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)

property stderr_mean

Get the standard error of the mean point estimate of each treatment on each outcome for sample X.

The output is a conservative upper bound.

Returns:

stderr_mean – The standard error of the mean point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)

property stderr_point

Get the standard error of the point estimate of each treatment on each outcome for sample X.

Returns:

stderr_point – The standard error of the point estimate of each treatment on each outcome for sample X. Note that when Y or T is a vector rather than a 2-dimensional array, the corresponding singleton dimensions in the output will be collapsed (e.g. if both are vectors, then the output of this method will be a scalar)

Return type:

array_like, shape (d_y, d_t)