Markov chain डायग्नोस्टिक्स और reproducibility

RJAGS के साथ Bayesian Modeling

Alicia Johnson

Associate Professor, Macalester College

Markov chain आउटपुट

RJAGS के साथ Bayesian Modeling

किन बातों पर विचार करें

  • एक "अच्छी" Markov chain कैसी दिखती है?

  • posterior की Markov chain approximation कितनी सटीक है?

  • कितनी iterations तक chain चलाएँ?

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: trace plots

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: trace plots

अच्छा: स्थिरता!

खराब: अस्थिरता

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: multiple chains

# COMPILE the model
sleep_jags <- jags.model(..., n.chains = 1)

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: multiple chains

# COMPILE the model
sleep_jags <- jags.model(..., n.chains = 2)

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: multiple chains

# COMPILE the model
sleep_jags <- jags.model(..., n.chains = 4)

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: multiple chains

# COMPILE the model
sleep_jags <- jags.model(..., n.chains = 4)

RJAGS के साथ Bayesian Modeling
summary(sleep_sim)
1. Empirical mean and standard deviation for each variable,
   plus standard error of the mean:

   Mean    SD Naive SE Time-series SE
m 29.10 8.968   0.2836         0.2820
s 40.07 7.887   0.2494         0.4227

2. Quantiles for each variable:

   2.5%   25%   50%   75% 97.5%
m 11.42 23.27 28.85 34.76 46.76
s 28.31 34.65 38.93 43.91 57.56
  • $m$ के posterior mean का अनुमान = 29.10 ms

  • इस अनुमान की (naive) standard error = 0.2836 ms
    SD / $\sqrt{\text{number of iterations}}$

RJAGS के साथ Bayesian Modeling

डायग्नोस्टिक: standard error

  • अनुमानित mean = 29.10 ms

  • (naive) standard error = 0.2836 ms

  • $29.10 \pm 2*0.2836$
RJAGS के साथ Bayesian Modeling

Markov chain वर्कफ़्लो

  • मॉडल परिभाषित करें, compile करें, simulate करें

  • ये diagnostics जाँचें:

    • Trace plots
    • Multiple chain आउटपुट
    • Standard errors
  • simulation finalize करें

RJAGS के साथ Bayesian Modeling

Markov chain को अंतिम रूप: Reproducibility

sleep_jags <- jags.model(textConnection(sleep_model), 
    data = list(Y = sleep_study$diff_3),
    inits = list(.RNG.name = "base::Wichmann-Hill",
                 .RNG.seed = 1989))
RJAGS के साथ Bayesian Modeling

अभ्यास करते हैं!

RJAGS के साथ Bayesian Modeling

Preparing Video For Download...