Skip to content

Commit 88f3c99

Browse files
authored
Merge pull request #359 from DoubleML/s-update-docstrings
Add shapes to property descriptions
2 parents 7a79af4 + 140691a commit 88f3c99

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

doubleml/double_ml.py

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,22 @@ def params_names(self):
287287
@property
288288
def predictions(self):
289289
"""
290-
The predictions of the nuisance models in form of a dictinary.
291-
Each key refers to a nuisance element with a array of values of shape ``(n_obs, n_rep, n_coefs)``.
290+
The predictions of the nuisance models in form of a dictionary.
291+
Each key refers to a nuisance element with a array of values (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
292292
"""
293293
return self._predictions
294294

295295
@property
296296
def nuisance_targets(self):
297297
"""
298-
The outcome of the nuisance models.
298+
The outcome of the nuisance models (shape (``n_obs``, ``n_rep``, ``n_coefs``)).
299299
"""
300300
return self._nuisance_targets
301301

302302
@property
303303
def nuisance_loss(self):
304304
"""
305-
The losses of the nuisance models (root-mean-squared-errors or logloss).
305+
The losses of the nuisance models (root-mean-squared-errors or logloss) (shape (``n_rep``, ``n_coefs``)).
306306
"""
307307
return self._nuisance_loss
308308

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

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

@@ -421,7 +421,7 @@ def sensitivity_params(self):
421421
@property
422422
def coef(self):
423423
"""
424-
Estimates for the causal parameter(s) after calling :meth:`fit`.
424+
Estimates for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
425425
"""
426426
return self._coef
427427

@@ -432,7 +432,7 @@ def coef(self, value):
432432
@property
433433
def se(self):
434434
"""
435-
Standard errors for the causal parameter(s) after calling :meth:`fit`.
435+
Standard errors for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
436436
"""
437437
return self._se
438438

@@ -443,23 +443,24 @@ def se(self, value):
443443
@property
444444
def t_stat(self):
445445
"""
446-
t-statistics for the causal parameter(s) after calling :meth:`fit`.
446+
t-statistics for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
447447
"""
448448
t_stat = self.coef / self.se
449449
return t_stat
450450

451451
@property
452452
def pval(self):
453453
"""
454-
p-values for the causal parameter(s) after calling :meth:`fit`.
454+
p-values for the causal parameter(s) after calling :meth:`fit` (shape (``n_coefs``,)).
455455
"""
456456
pval = 2 * norm.cdf(-np.abs(self.t_stat))
457457
return pval
458458

459459
@property
460460
def boot_t_stat(self):
461461
"""
462-
Bootstrapped t-statistics for the causal parameter(s) after calling :meth:`fit` and :meth:`bootstrap`.
462+
Bootstrapped t-statistics for the causal parameter(s) after calling :meth:`fit` and :meth:`bootstrap`
463+
(shape (``n_rep_boot``, ``n_coefs``, ``n_rep``)).
463464
"""
464465
if self._framework is None:
465466
boot_t_stat = None
@@ -470,14 +471,16 @@ def boot_t_stat(self):
470471
@property
471472
def all_coef(self):
472473
"""
473-
Estimates of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`.
474+
Estimates of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`
475+
(shape (``n_coefs``, ``n_rep``)).
474476
"""
475477
return self._all_coef
476478

477479
@property
478480
def all_se(self):
479481
"""
480-
Standard errors of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`.
482+
Standard errors of the causal parameter(s) for the ``n_rep`` different sample splits after calling :meth:`fit`
483+
(shape (``n_coefs``, ``n_rep``)).
481484
"""
482485
return self._all_se
483486

0 commit comments

Comments
 (0)