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.
Currently the following code throws an error:
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.