salbalkus / CausalTables.jl

A new type of Table to store and simulate data for causal inference in Julia.
https://salbalkus.github.io/CausalTables.jl/
MIT License
0 stars 0 forks source link

Rename and allow parameters in @dgp macro #21

Closed salbalkus closed 2 months ago

salbalkus commented 4 months ago

Currently the following code throws an error:

sem(p) = @dgp(
        A ~ Bernoulli(p),
        As = Sum(:A),
        Y ~ @.(Normal(0.1 * (:A + :As), 1)),
    )

This demonstrates that it is not possible to use the @dgp macro with parameters. Also, I suggest changing the name of the dgp macro to something like "sem" for the structural equation model, since it really encodes a structural equation model. "dgp" should refer to the DataGeneratingProcess to avoid confusion.