Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions doubleml/double_ml.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@ def params_names(self):
@property
def predictions(self):
"""
The predictions of the nuisance models in form of a dictinary.
Each key refers to a nuisance element with a array of values of shape ``(n_obs, n_rep, n_coefs)``.
The predictions of the nuisance models in form of a dictionary.
Each key refers to a nuisance element with a array of values (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
"""
return self._predictions

@property
def nuisance_targets(self):
"""
The outcome of the nuisance models.
The outcome of the nuisance models (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
"""
return self._nuisance_targets

@property
def nuisance_loss(self):
"""
The losses of the nuisance models (root-mean-squared-errors or logloss).
The losses of the nuisance models (root-mean-squared-errors or logloss) (shape (``n_rep``, ``n_coefs``)).
"""
return self._nuisance_loss

Expand Down Expand Up @@ -392,16 +392,16 @@ def psi_elements(self):
"""
Values of the score function components after calling :meth:`fit`;
For models (e.g., PLR, IRM, PLIV, IIVM) with linear score (in the parameter) a dictionary with entries ``psi_a``
and ``psi_b`` for :math:`\\psi_a(W; \\eta)` and :math:`\\psi_b(W; \\eta)`.
and ``psi_b`` for :math:`\\psi_a(W; \\eta)` and :math:`\\psi_b(W; \\eta)` (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
"""
return self._psi_elements

@property
def sensitivity_elements(self):
"""
Values of the sensitivity components after calling :meth:`fit`;
If available (e.g., PLR, IRM) a dictionary with entries ``sigma2``, ``nu2``, ``psi_sigma2``, ``psi_nu2``
and ``riesz_rep``.
If available (e.g., PLR, IRM) a dictionary with entries ``sigma2``, ``nu2`` (shape (``1``, ``n_rep``, ``n_coefs``)),
``psi_sigma2``, ``psi_nu2`` and ``riesz_rep`` (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
"""
return self._sensitivity_elements

Expand All @@ -421,7 +421,7 @@ def sensitivity_params(self):
@property
def coef(self):
"""
Estimates for the causal parameter(s) after calling :meth:`fit`.
Estimates for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
"""
return self._coef

Expand All @@ -432,7 +432,7 @@ def coef(self, value):
@property
def se(self):
"""
Standard errors for the causal parameter(s) after calling :meth:`fit`.
Standard errors for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
"""
return self._se

Expand All @@ -443,23 +443,24 @@ def se(self, value):
@property
def t_stat(self):
"""
t-statistics for the causal parameter(s) after calling :meth:`fit`.
t-statistics for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
"""
t_stat = self.coef / self.se
return t_stat

@property
def pval(self):
"""
p-values for the causal parameter(s) after calling :meth:`fit`.
p-values for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
"""
pval = 2 * norm.cdf(-np.abs(self.t_stat))
return pval

@property
def boot_t_stat(self):
"""
Bootstrapped t-statistics for the causal parameter(s) after calling :meth:`fit` and :meth:`bootstrap`.
Bootstrapped t-statistics for the causal parameter(s) after calling :meth:`fit` and :meth:`bootstrap`
(shape (``n_rep_boot``, ``n_coefs``, ``n_rep``)).
"""
if self._framework is None:
boot_t_stat = None
Expand All @@ -470,14 +471,16 @@ def boot_t_stat(self):
@property
def all_coef(self):
"""
Estimates of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`.
Estimates of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`
(shape (``n_coefs``, ``n_rep``)).
"""
return self._all_coef

@property
def all_se(self):
"""
Standard errors of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`.
Standard errors of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`
(shape (``n_coefs``, ``n_rep``)).
"""
return self._all_se

Expand Down