Skip to content

Commit 912c8a3

Browse files
committed
Deploying to gh-pages from @ acead59 🚀
1 parent 83d5edf commit 912c8a3

15 files changed

Lines changed: 57 additions & 57 deletions

articles/Chapter07.html

Lines changed: 36 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

articles/Chapter07.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -657,7 +657,7 @@ for (m in seq_len(ndraws + nburn)) {
657657
C0 + .5 * (1 - phi^2) * (y0 - zeta / (1 - phi))^2 + .5 * crossprod(tmp))
658658

659659
# Step (c): Draw the intercept
660-
BT <- 1 / (1 / B0 + (length(y) + 1) / sigma2)
660+
BT <- 1 / (1 / B0 + (1 + phi) / (sigma2 * (1 - phi)) + length(y) / sigma2)
661661
bT <- BT * (b0 / B0 + ((1 + phi) * y0 +
662662
y[1] - phi * y0 + sum(y[-1] - phi * y[-length(y)])) / sigma2)
663663
zeta <- rnorm(1, bT, sqrt(BT))
@@ -716,7 +716,7 @@ for (m in seq_len(ndraws + nburn)) {
716716
C0 + .5 * (1 - phi^2) * (y0 - zeta / (1 - phi))^2 + .5 * crossprod(tmp))
717717

718718
# Step (c): Draw the intercept
719-
BT <- 1 / (1 / B0 + (length(y) + 1) / sigma2)
719+
BT <- 1 / (1 / B0 + (1 + phi) / (sigma2 * (1 - phi)) + length(y) / sigma2)
720720
bT <- BT * (b0 / B0 + ((1 + phi) * y0 +
721721
y[1] - phi * y0 + sum(y[-1] - phi * y[-length(y)])) / sigma2)
722722
zeta <- rnorm(1, bT, sqrt(BT))
@@ -820,19 +820,19 @@ knitr::kable(round(ess))
820820
|:---------------------|-----:|------:|-------:|------:|
821821
| unrestricted | 9562 | 10000 | 10000 | NA |
822822
| postprocessed | 9184 | 9592 | 9592 | NA |
823-
| betapriorflat | 2189 | 1964 | 9496 | 9255 |
824-
| betapriorinformative | 784 | 397 | 5198 | 10000 |
823+
| betapriorflat | 2301 | 2189 | 10000 | 10000 |
824+
| betapriorinformative | 634 | 338 | 6211 | 10000 |
825825

826826
``` r
827827
knitr::kable(round(ndraws / ess, 2))
828828
```
829829

830-
| | zeta | phi | sigma2 | y0 |
831-
|:---------------------|------:|------:|-------:|-----:|
832-
| unrestricted | 1.05 | 1.00 | 1.00 | NA |
833-
| postprocessed | 1.09 | 1.04 | 1.04 | NA |
834-
| betapriorflat | 4.57 | 5.09 | 1.05 | 1.08 |
835-
| betapriorinformative | 12.76 | 25.21 | 1.92 | 1.00 |
830+
| | zeta | phi | sigma2 | y0 |
831+
|:---------------------|------:|------:|-------:|----:|
832+
| unrestricted | 1.05 | 1.00 | 1.00 | NA |
833+
| postprocessed | 1.09 | 1.04 | 1.04 | NA |
834+
| betapriorflat | 4.35 | 4.57 | 1.00 | 1 |
835+
| betapriorinformative | 15.77 | 29.55 | 1.61 | 1 |
836836

837837
We now repeat the above exercise, but use the conditional posterior
838838
resulting from an auxiliary moment-matched prior in Step (d).
@@ -899,7 +899,7 @@ for (m in seq_len(ndraws + nburn)) {
899899
C0 + .5 * (1 - phi^2) * (y0 - zeta / (1 - phi))^2 + .5 * crossprod(tmp))
900900

901901
# Step (c): Draw the intercept
902-
BT <- 1 / (1 / B0 + (length(y) + 1) / sigma2)
902+
BT <- 1 / (1 / B0 + (1 + phi) / (sigma2 * (1 - phi)) + length(y) / sigma2)
903903
bT <- BT * (b0 / B0 + ((1 + phi) * y0 +
904904
y[1] - phi * y0 + sum(y[-1] - phi * y[-length(y)])) / sigma2)
905905
zeta <- rnorm(1, bT, sqrt(BT))
@@ -999,17 +999,17 @@ knitr::kable(round(ess))
999999

10001000
| | zeta | phi | sigma2 | y0 |
10011001
|:----------|-----:|----:|-------:|------:|
1002-
| Sampler 1 | 784 | 397 | 5198 | 10000 |
1003-
| Sampler 2 | 1045 | 548 | 6342 | 10000 |
1002+
| Sampler 1 | 634 | 338 | 6211 | 10000 |
1003+
| Sampler 2 | 966 | 504 | 7172 | 10000 |
10041004

10051005
``` r
10061006
knitr::kable(round(ndraws / ess, 2))
10071007
```
10081008

10091009
| | zeta | phi | sigma2 | y0 |
10101010
|:----------|------:|------:|-------:|----:|
1011-
| Sampler 1 | 12.76 | 25.21 | 1.92 | 1 |
1012-
| Sampler 2 | 9.57 | 18.25 | 1.58 | 1 |
1011+
| Sampler 1 | 15.77 | 29.55 | 1.61 | 1 |
1012+
| Sampler 2 | 10.35 | 19.85 | 1.39 | 1 |
10131013

10141014
## Section 7.3: Some Extensions
10151015

@@ -1375,17 +1375,17 @@ knitr::kable(round(accepts, 2))
13751375
|:---------------|-----:|-------:|-----:|
13761376
| Gaussian RW | 0.87 | 0.31 | 0.03 |
13771377
| truncated RW | 0.87 | 0.35 | 0.06 |
1378-
| transformed RW | 0.93 | 0.52 | 0.07 |
1378+
| transformed RW | 0.94 | 0.52 | 0.07 |
13791379

13801380
``` r
13811381
knitr::kable(round(IF, 1))
13821382
```
13831383

13841384
| | tiny | medium | huge |
13851385
|:---------------|------:|-------:|-----:|
1386-
| Gaussian RW | 41.0 | 5.4 | 46.7 |
1387-
| truncated RW | 36.5 | 5.2 | 31.5 |
1388-
| transformed RW | 155.6 | 4.7 | 20.8 |
1386+
| Gaussian RW | 39.3 | 5.8 | 46.0 |
1387+
| truncated RW | 36.3 | 5.2 | 31.8 |
1388+
| transformed RW | 143.1 | 4.7 | 20.5 |
13891389

13901390
## Section 7.4: Markov modeling for a panel of categorical time series
13911391

115 Bytes
Loading
-150 Bytes
Loading
2.43 KB
Loading
1.7 KB
Loading
88 Bytes
Loading
-604 Bytes
Loading
-584 Bytes
Loading
-386 Bytes
Loading

0 commit comments

Comments
 (0)