Skip to content

Commit 71d7924

Browse files
committed
changes in text
1 parent 5cd88a3 commit 71d7924

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

vignettes/Chapter06.Rmd

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -551,6 +551,10 @@ names(res_sigma2.sc) <- colnames(res_beta.sc)
551551
552552
knitr::kable(t(round(res_sigma2.sc, 3)))
553553
```
554+
Obviously, taking into account more covariates the posterior mean of
555+
the error variance is considerably lower than in the model with only
556+
_Budget_ and _Screens_ used as covariates.
557+
554558

555559
The different signs of the effects of _Vol-4-6_ and _Vol-1-3_ deserve
556560
some further comment. The two covariates are highly correlated. Due
@@ -658,13 +662,14 @@ reg_hs <- function(y, X, b0 = 0, B0 = 10000, c0 = 2.5, C0 = 1.5,
658662
}
659663
```
660664

661-
### Example 6.7: Movie data- ANalysis under Horseshoe prior
665+
### Example 6.7: Movie data- Analysis under Horseshoe prior
662666

663667
We estimate the parameters in the regression model with the same prior
664668
on intercept and error variance as in the semi-conjugate prior, but a
665669
horseshoe prior on the covariate effects.
666670

667671
```{r}
672+
set.seed(421)
668673
post.draws.hs <- reg_hs(y, X, M = M)
669674
```
670675

@@ -678,9 +683,11 @@ colnames(res_beta.hs) <- c("2.5% quantile", "posterior mean", "97.5% quantile")
678683
rownames(res_beta.hs) <- colnames(X)
679684
knitr::kable(round(res_beta.hs, 3))
680685
```
686+
Estimation results are very similar to those under the semi-conjugate prior for the effects of Budget,
687+
Weeks, Screens, Vol-4-6 and Vol-1-3. For all other covariates the posterior means of their effects are closer to zero and the 95% posterior intervals are tighter under the horseshoe than under the semi-conjugate prior, indicating shrinkage to zero.
681688

682-
We also report the estimation results for the error variance.
683689

690+
However, the estimation results on the error variance are very similar to those under the semi-conjugate prior.
684691
```{r}
685692
sigma2.hs <- post.draws.hs$sigma2s
686693
res_sigma2.hs <- res.mcmc(sigma2.hs)
@@ -689,16 +696,12 @@ names(res_sigma2.hs) <- colnames(res_beta.hs)
689696
knitr::kable(t(round(res_sigma2.hs, 3)))
690697
```
691698

692-
Obviously, taking into account more covariates the posterior mean of
693-
the error variance is considerably lower than in the model with only
694-
_Budget_ and _Screens_ used as covariates.
695-
696699
We next have a look at the posterior distributions. The plots on the left hand
697700
side show the posterior distribution for the regression effects under the
698701
semi-conjugate prior, those on the right hand side the posterior distributions
699-
under the horseshoe prior. Note that the
702+
under the horseshoe prior. Whereas the
700703
posterior distributions are symmetric under the semi-conjugate
701-
prior, whereas this is not the case under the horseshoe prior.
704+
prior, this is not the case under the horseshoe prior.
702705

703706
```{r, echo = -1}
704707
par(mfrow = c(ncol(beta.hs) / 2, 2), mgp = c(1.6, .6, 0),

0 commit comments

Comments
 (0)