From a8f46db8a298368219193fffbfd477a6fa7da93c Mon Sep 17 00:00:00 2001 From: Jonathan Berrisch Date: Sun, 22 Jun 2025 09:33:05 +0200 Subject: [PATCH] Fix time-varying weights plot --- index.html | 740 ++++++++++++++++++++++++++--------------------------- index.qmd | 25 +- 2 files changed, 380 insertions(+), 385 deletions(-) diff --git a/index.html b/index.html index 7661bba..43fba47 100644 --- a/index.html +++ b/index.html @@ -25933,7 +25933,7 @@ Berrisch, J. (
-

+

@@ -25941,7 +25941,7 @@ Berrisch, J. (
- +
@@ -25949,7 +25949,7 @@ Berrisch, J. (
- +
@@ -25957,190 +25957,190 @@ Berrisch, J. (
-
@@ -27230,7 +27230,7 @@ Y_{t} = \mu + Y_{t-1} + \varepsilon_t \quad \text{with} \quad \varepsilon_t = \
- +
@@ -27238,194 +27238,194 @@ Y_{t} = \mu + Y_{t-1} + \varepsilon_t \quad \text{with} \quad \varepsilon_t = \
-
diff --git a/index.qmd b/index.qmd index 8db9c3f..ea1d0af 100644 --- a/index.qmd +++ b/index.qmd @@ -795,17 +795,15 @@ Berrisch, J., & Ziel, F. [-@BERRISCH2023105221]. *Journal of Econometrics*, 237( ```{r, echo = FALSE, fig.height=8, cache = TRUE} par(mfrow = c(3, 3), mar = c(2, 2, 2, 2)) -set.seed(1) +set.seed(42) # Data -X <- matrix(ncol = 3, nrow = 15) -X[, 1] <- seq(from = 8, to = 12, length.out = 15) + 0.25 * rnorm(15) -X[, 2] <- 10 + 0.25 * rnorm(15) -X[, 3] <- seq(from = 12, to = 8, length.out = 15) + 0.25 * rnorm(15) +X <- matrix(ncol = 2, nrow = 15) +X[, 1] <- seq(from = 8, to = 12, length.out = 15) + 0.4 * rnorm(15) +X[, 2] <- seq(from = 12, to = 8, length.out = 15) + 0.4 * rnorm(15) # Weights -w <- matrix(ncol = 3, nrow = 15) +w <- matrix(ncol = 2, nrow = 15) w[, 1] <- sin(0.1 * 1:15) -w[, 2] <- cos(0.1 * 1:15) -w[, 3] <- seq(from = -2, 0.25, length.out = 15)^2 +w[, 2] <- seq(from = -2, 0.25, length.out = 15)^2 w <- (w / rowSums(w)) # Vis plot(X[, 1], @@ -825,27 +823,24 @@ plot(w[, 1], xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n", col = "#80C684FF" ) -text(6, 0.5, TeX("$w_1(t)$"), cex = 2, col = "#80C684FF") +text(6, 0.5, latex2exp::TeX("$w_1(t)$"), cex = 2, col = "#80C684FF") arrows(13, 0.25, 15, 0.0, , lwd = 4, bty = "n", col = "#414141FF") plot.new() plot.new() plot.new() - -text(6, 0.6, TeX("$w_2(t)$"), cex = 2, col = "#FFD44EFF") -arrows(13, 0.5, 15, 0.5, , lwd = 4, bty = "n", col = "#414141FF") plot(rowSums(X * w), lwd = 4, type = "l", xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n", col = "#D81A5FFF") -plot(X[, 3], +plot(X[, 2], lwd = 4, type = "l", ylim = c(8, 12), xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n", col = "#FFD44EFF" ) -plot(w[, 3], +plot(w[, 2], lwd = 4, type = "l", ylim = c(0, 1), xlab = "", ylab = "", xaxt = "n", yaxt = "n", bty = "n", col = "#FFD44EFF" ) -text(6, 0.25, TeX("$w_2(t)$"), cex = 2, col = "#FFD44EFF") +text(6, 0.25, latex2exp::TeX("$w_2(t)$"), cex = 2, col = "#FFD44EFF") arrows(13, 0.75, 15, 1, , lwd = 4, bty = "n", col = "#414141FF") ```