From 140691a68fb8c30b3cba22d71bf2690f12eac731 Mon Sep 17 00:00:00 2001 From: SvenKlaassen Date: Fri, 17 Oct 2025 15:58:40 +0200 Subject: [PATCH] update docstring dimensions --- doubleml/double_ml.py | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/doubleml/double_ml.py b/doubleml/double_ml.py index 8e7de835..d45f31b8 100644 --- a/doubleml/double_ml.py +++ b/doubleml/double_ml.py @@ -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 @@ -392,7 +392,7 @@ 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 @@ -400,8 +400,8 @@ def psi_elements(self): 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 @@ -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 @@ -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 @@ -443,7 +443,7 @@ 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 @@ -451,7 +451,7 @@ def t_stat(self): @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 @@ -459,7 +459,8 @@ def pval(self): @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 @@ -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