Skip to content

Commit

Permalink
Update Missing
Browse files Browse the repository at this point in the history
  • Loading branch information
ghadialhajj committed Jun 14, 2024
1 parent f39e9c8 commit c8858f8
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions docs/source/tutorials/selection_and_stratification.rst
Original file line number Diff line number Diff line change
Expand Up @@ -184,58 +184,58 @@ In this case, the missingness pattern is random and the probability of an entry
of any missing or non-missing values of other variables in the data-generating process. In other words,

.. math::
\Pr(M=0|Y_obs,Y_mis,\psi) = \Pr(M=0|\psi)
\Pr(M=0|Y_{obs},Y_{mis},\psi) = \Pr(M=0|\psi)
.. tabs::

.. tab:: Python
.. highlight:: python
.. code-block:: python
.. highlight:: python
.. code-block:: python
import dagsim.base as ds
import numpy as np
import dagsim.base as ds
import numpy as np
underlying_value = ds.Node(name="underlying_value", function=np.random.normal)
index_node = ds.Node(name="index_node", function=np.random.randint, kwargs={"low":0, "high":2})
MCAR = ds.Missing(name="MCAR", underlying_value=underlying_value, index_node=index_node)
underlying_value = ds.Node(name="underlying_value", function=np.random.normal)
index_node = ds.Node(name="index_node", function=np.random.randint, kwargs={"low":0, "high":2})
MCAR = ds.Missing(name="MCAR", underlying_value=underlying_value, index_node=index_node)
list_nodes = [underlying_value, index_node, MCAR]
my_graph = ds.Graph(list_nodes=list_nodes, name="MCAR")
list_nodes = [underlying_value, index_node, MCAR]
my_graph = ds.Graph(list_nodes=list_nodes, name="MCAR")
data = my_graph.simulate(num_samples=10, csv_name="MCAR")
data = my_graph.simulate(num_samples=10, csv_name="MCAR")
.. tab:: YAML
.. highlight:: yaml
.. code-block:: yaml
.. tab:: YAML
.. highlight:: yaml
.. code-block:: yaml
graph:
python_file: hello_world_functions.py
nodes:
underlying_value:
function: numpy.random.normal
index_node:
function: numpy.random.randint(0,2)
MCAR:
underlying_value: underlying_value
index_node: index_node
graph:
python_file: hello_world_functions.py
nodes:
underlying_value:
function: numpy.random.normal
index_node:
function: numpy.random.randint(0,2)
MCAR:
underlying_value: underlying_value
index_node: index_node
instructions:
simulation:
csv_name: parser
num_samples: 10
instructions:
simulation:
csv_name: parser
num_samples: 10
Missing At Random (MAR)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In this case, the probability of an entry going missing depends on other observed values in the model, but
does not depend on any unobserved quantities:

.. math::
\Pr(M=0|Y_obs,Y_mis,\psi) = \Pr(M=0|Y_obs,\psi)
\Pr(M=0|Y_{obs},Y_{mis},\psi) = \Pr(M=0|Y_{obs},\psi)
In this case, :math:`\Pr(M=0)` depends on the observed value of :math:`Y_obs`.
In this case, :math:`\Pr(M=0)` depends on the observed value of :math:`Y_{obs}`.

.. code-block:: python
Expand Down Expand Up @@ -266,10 +266,10 @@ In the MNAR case, the probability that an entry is missing depends not only on o
so the conditional probability does not simplify:

.. math::
\Pr(M=0|Y_obs,Y_mis,\psi) = \Pr(M=0|Y_obs,Y_mis,\psi)
\Pr(M=0|Y_{obs},Y_{mis},\psi) = \Pr(M=0|Y_{obs},Y_{mis},\psi)
In this case, :math:`\Pr(M=0)` depends on the observed value of :math:`Y_obs` and the, possibly, unobserved,
would-have-been value of :math:`Y_mis`.
In this case, :math:`\Pr(M=0)` depends on the observed value of :math:`Y_{obs}` and the, possibly, unobserved,
would-have-been value of :math:`Y_{mis}`.

.. code-block:: python
Expand Down

0 comments on commit c8858f8

Please sign in to comment.