File: pp_about.R

package info (click to toggle)
r-cran-shinystan 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,172 kB
  • sloc: sh: 15; makefile: 7
file content (38 lines) | stat: -rw-r--r-- 1,240 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
div(
  withMathJax(),
  h3(style = "color: #337ab7;", "What is posterior predictive checking?"),
  p(
    strong("The idea behind posterior predictive checking is simple:")
  ),
  p(em("If our model is a good fit then we should be able to use it to generate")),
  p(em("data that looks a lot like the data we observed.")),
  br(),
  p(
    "To generate this 'replicated' data we use the",
    em("posterior predictive distribution")
  ),
  span(
    style = "color: #337ab7; font-face: bold;",
    withMathJax(
      "$$ p(y^{rep} | y )  = \\int p(y^{rep} | \\theta) p(\\theta | y ) d \\theta,$$"
    )
  ),
  p(
    "where \\(y\\) is the observed data and \\(\\theta\\) the parameters in our model."
  ),
  br(),
  p(
    "For each draw of \\(\\theta\\) from the posterior \\(p(\\theta | y) \\)
    we simulate data \\(y^{rep}\\) from the posterior predictive distribution \\(p(y^{rep} | y) \\)."
  ),
  br(),
  p(
    "Using the simulations of \\(y^{rep}\\) we can make various
    graphical displays comparing our observed data to the replications."
  ),
  hr(),
  helpText(
    "For a more thorough discussion of posterior predictive checking see Chapter 6 of",
    a("BDA3.", href = "http://www.stat.columbia.edu/~gelman/book/")
  )
)