# Types The public functions in `idid` use a small set of type aliases and typed-dict configuration objects. They are documented here directly instead of being re-exported from the top-level package. ```{py:currentmodule} idid._types ``` ## Type Aliases ```{py:data} Control :canonical: idid._types.Control Control-group rule accepted by {py:func}`idid.estimate`. Allowed values: - `"never"`: use the never-exposed cohort, coded as `E = 0`. - `"notyet"`: use units not yet exposed by time `t` as controls. ``` ```{py:data} Method :canonical: idid._types.Method Cell-level estimation method accepted by {py:func}`idid.estimate`. Allowed values: - `"dr"`: doubly robust estimation. - `"dml"`: double machine learning. - `"reg"`: outcome regression. - `"ipw"`: inverse-probability weighting. - `"std_ipw"`: standardized inverse-probability weighting. ``` ```{py:data} AggMethod :canonical: idid._types.AggMethod Aggregation method accepted by {py:func}`idid.agg_latt`. Allowed values: - `"simple"`: aggregate all post-exposure LATTs. - `"group"` / `"cohort"`: aggregate by exposure cohort. - `"cohort_custom"`: aggregate using a user-supplied cohort grouping. - `"calendar"`: aggregate by calendar time. - `"calendar_cumu"`: cumulative calendar-time aggregation. - `"dynamic"`: aggregate by event-time horizon. - `"dynamic_bal"`: balanced dynamic aggregation. ``` ```{py:data} FloatArray :canonical: idid._types.FloatArray Floating-point NumPy array type used in lower-level estimator and nuisance model interfaces. ``` ## Configuration Objects `````{py:class} OutcomeModel() :canonical: idid._types.OutcomeModel Protocol for outcome nuisance models used by the DML estimators. Required methods: - `fit(X, y)` - `predict(X)` ````` `````{py:class} TreatmentModel() :canonical: idid._types.TreatmentModel Protocol for treatment / propensity nuisance models used by the DML estimators. Required methods: - `fit(X, y)` - `predict_proba(X)` ````` `````{py:class} OutcomeRegressionKwargs() :canonical: idid._types.OutcomeRegressionKwargs Bases: {py:obj}`typing.TypedDict` ```{autodoc2-docstring} idid._types.OutcomeRegressionKwargs ``` ````{py:attribute} ns_est :canonical: idid._types.OutcomeRegressionKwargs.ns_est :type: idid._types.NuisanceEstimator ```{autodoc2-docstring} idid._types.OutcomeRegressionKwargs.ns_est ``` ```` ````{py:attribute} use_levels :canonical: idid._types.OutcomeRegressionKwargs.use_levels :type: bool ```{autodoc2-docstring} idid._types.OutcomeRegressionKwargs.use_levels ``` ```` ````` `````{py:class} DMLKwargs() :canonical: idid._types.DMLKwargs Bases: {py:obj}`typing.TypedDict` ```{autodoc2-docstring} idid._types.DMLKwargs ``` ````{py:attribute} nfolds :canonical: idid._types.DMLKwargs.nfolds :type: int ```{autodoc2-docstring} idid._types.DMLKwargs.nfolds ``` ```` ````{py:attribute} m_m :canonical: idid._types.DMLKwargs.m_m :type: idid._types.OutcomeModel ```{autodoc2-docstring} idid._types.DMLKwargs.m_m ``` ```` ````{py:attribute} g_m :canonical: idid._types.DMLKwargs.g_m :type: idid._types.TreatmentModel ```{autodoc2-docstring} idid._types.DMLKwargs.g_m ``` ```` ````{py:attribute} p_m :canonical: idid._types.DMLKwargs.p_m :type: idid._types.TreatmentModel ```{autodoc2-docstring} idid._types.DMLKwargs.p_m ``` ```` `````