betanalpha / knitr_case_studies

Inference case studies in knitr
162 stars 94 forks source link

Prior standard deviation in "A Principled Bayesian Workflow" #22

Closed dipetkov closed 4 years ago

dipetkov commented 4 years ago

Since the prior is a half-normal (i.e., truncated at 0), shouldn't we use qnorm(0.995) instead of qnorm(0.99) to get the prior standard deviation?

TruncatedNormal::qtnorm(0.99, 0, 15 / qnorm(.995), 0, Inf)
#> [1] 15
TruncatedNormal::qtnorm(0.99, 0, 15 / qnorm(.99), 0, Inf)
#> [1] 16.60863

# where

15 / qnorm(.995)
#> [1] 5.823367
15 / qnorm(.99)
#> [1] 6.447875

Created on 2019-11-18 by the reprex package (v0.3.0)

betanalpha commented 4 years ago

Thanks! This is correct and has been fixed in local edits (along with many other bugs and types) that will eventually make it to the published version when I get a chance at a proper update. For now I'm going to close this.