Fanplots not currently available in the plot toolbox?

I was looking at the plot functionalities for stanfit objects and it seems that among all the current plot possibilities provided by rstan and bayesplot packages, fanplots are not yet available ?

I have a series of parameters that depend on time and I would like to generate plots which represent the median and 95% credible intervals like, for instance, the following plots:


I know how I can generate these plots by extracting the parameters from the stanfit object and use either using the fanplot or ggfan packages but I was wondering if there exists already a plotting function to generate fans from rstan/bayesplot I am not aware of ? Maybe @jonah can help for this question.

Thanks !

2 Likes

I looked into this recently and while I proposed its inclusion way back, it hasn’t yet been implemented in bayesplot, and I’ve personally been too swamped to do a PR myself. Have enough interest to do one?

I have some interest but I have to find some time. As you discussed, the geom_fan option of the ggfan package already does a great job.

If bayesplot is ok to create a dependency on ggfan, one needs to create the appropriate dataframe from the rstanfit and then call geom_fan on this dataframe. Does bayesplot already include a function that creates a dataframe from a list of parameters ?