post |>compute_fitted_values() |>plot(col ="#0056B9")
+
post |>compute_fitted_values() |>plot(col ="#0056B9")
diff --git a/index.qmd b/index.qmd
index 3ca2f0e..30ef3fd 100644
--- a/index.qmd
+++ b/index.qmd
@@ -259,6 +259,21 @@ spec2 |>
+## My first steps with [bsvars](https://cran.r-project.org/package=bsvars){style="color:#FFD800;"}
+
+### Exercise.
+
+1. Download **R** script [w4UKR_bsvars.R](https://github.com/bsvars/2024-08-bsvars-w4UKR/blob/main/w4UKR_bsvars.R)
+2. Open the file in your **RStudio**
+3. Execute the code line by line
+
+#### You have just estimated your first model using the **bsvars** package! YAY!
+
+4. Modify the line specifying the model to
+```
+specify_bsvar_t$new(p = 4) |>
+```
+5. Run the code line by line
@@ -736,6 +751,14 @@ $$ $$
+## [bsvars](https://cran.r-project.org/package=bsvars){style="color:#FFD800;"} hypothesis verification
+
+### ...for autoregressive parameters.
+
+### Exercise.
+
+1. Download the **R** script [w4UKR_bsvars_Granger.R](https://github.com/bsvars/2024-08-bsvars-w4UKR/blob/main/w4UKR_bsvars_Granger.R)
+2. Verify the hypothesis of no Granger causality from ttr to gdp
## [bsvars](https://cran.r-project.org/package=bsvars){style="color:#FFD800;"} modeling of monetary policy {background-color="#0056B9"}
diff --git a/w4UKR_bsvars_Granger.R b/w4UKR_bsvars_Granger.R
index e69de29..4a8c1b0 100644
--- a/w4UKR_bsvars_Granger.R
+++ b/w4UKR_bsvars_Granger.R
@@ -0,0 +1,19 @@
+
+
+library(bsvars)
+
+# upload data
+data(us_fiscal_lsuw) # upload dependent variables
+
+set.seed(123)
+us_fiscal_lsuw |>
+ specify_bsvar$new() |>
+ estimate(S = 1000) |>
+ estimate(S = 2000) -> post
+
+post$last_draw$starting_values$A # study the structure of the A matrix
+
+# verify no Granger causality from ttr to gdp
+H0 = matrix(NA, 3, 4)
+H0[,] = 0 # modify this line to set appropriate restriction
+post |> verify_autoregression(hypothesis = H0) |> summary()