betanalpha / knitr_case_studies

Inference case studies in knitr
162 stars 94 forks source link

Unexpected behaviour of check_treedepth() #7

Closed stemangiola closed 6 years ago

stemangiola commented 6 years ago

I'm not sure whether I am interpreting the output message correctly, for the same stan fit object I get:

 check_treedepth(tabi_res$fit, max_depth = 10)
[1] "6 of 1000 iterations saturated the maximum tree depth of 10 (0.6%)"
[1] "  Run again with max_depth set to a larger value to avoid saturation"

> check_treedepth(tabi_res$fit, max_depth = 12)
[1] "988 of 1000 iterations saturated the maximum tree depth of 12 (98.8%)"
[1] "  Run again with max_depth set to a larger value to avoid saturation"

Shouldn't the first check include the interactions of the second check?

betanalpha commented 6 years ago

No. check_treedepth compares equality against the given max_depth, not greater than or equality. At the moment it is up to the user to specify the correct maximum treedepth.