Diagnostic plot subset

Hi I have a question about plotting. Is there a way to plot only a subset of each estimated parameter? I have around 100-400 number of estimates for each parameter category. If plotting too many at once, the plots are not clear enough, so I was wondering if there is a way to plot a subset of each one every time. Thanks!

In rstan, there’s a ‘pars’ argument. e.g., stan_hist(fit, pars = "beta")

Thanks for your reply! Is there a argument I can use to plot a subset of the parameter? e.g., pars= a subset of beta

It takes a character vector, so if you want betas 1-4, you could do: stan_hist(fit, pars = paste0("beta[",1:4,"]"))

Also, bayesplot supports regex_pars, so you can specify by regex.

Thanks! That is exactly what I need. But would you mind explaining what is regex_par? haven’t tried bayesplot yet.

Try it first, and read the docs. The gist is - You can use regular expressions (e.g., “beta[([:digit:])+,\1]” to get all beta[1,1], beta[2,2], beta[3,3], etc) for extracting values, rather than selecting them via string pasting.

ok! thank you so much!