Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facilitating DAGs #194

Open
bgoodri opened this issue May 17, 2019 · 2 comments
Open

Facilitating DAGs #194

bgoodri opened this issue May 17, 2019 · 2 comments

Comments

@bgoodri
Copy link

bgoodri commented May 17, 2019

I'm not sure that this should actually go into bayesplot but I figure the people who would be interested and able to do something like this would read bayesplot issues.

I think it would be good if we could draw Directed Acyclic Graphs (DAGs) for models that can be represented by DAGs. We can't do that just from posterior draws or even from Stan code (in general), but I hope we could render a DAG that a user expressed (or maybe generate them from syntax in brms / rstanarm / other packages).

The ggdag package is nice but is focused on identification of causal effects rather than a description of the generative process. It doesn't seem to have a great way of representing parameters, but maybe that could be added with a PR. PyMC3 recently added something like this, although I don't like some things about the formatting. I think WinBUGS established a convention of using rectangles for observables and ovals for unobservables. Also, I'm not sure I like the foo ~ Distribution being part of the node label. Maybe we could use different colors for each node and put the distributional assumptions into the key?

Anyway, if people have other ideas, we can discuss them here.

@tjmahr
Copy link
Collaborator

tjmahr commented May 17, 2019

greta does something like this. https://greta-stats.org/articles/get_started.html#plotting

image

But I don't know how its DAG building is implemented, but the plotting uses DiagrammeR. I've used to DiagrammeR convert lavaan SEM models into graphs. DiagrammeR builds graphs from dataframes, so the main task would be to have a language that describe interrelations among model parameters and then use that build a dataframe for plotting.

@bgoodri
Copy link
Author

bgoodri commented May 17, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants