The easiest way to estimate Wavelet Coherence Analysis in Rstudio
10.6 هزار بار بازدید -
2 سال پیش
-
In this video I focus
In this video I focus on the easiest and practical way to estimate Wavelet Coherence Analysis (WCA).
The best programme to run the WCA is the R Studio. Someone can download the programme from the following link (the R must already installed):
https://www.rstudio.com/products/rstu...
Some paper which use the wavelets techinque are:
https://www.sciencedirect.com/science...
https://www.sciencedirect.com/science...
https://www.sciencedirect.com/science...
The code that runs in the video is the following:
library(biwavelet)
attach(CDS_returns)
A=CDS_spread_returns_Germany
B=CDS_spread_returns_France
t1 = cbind(1:1655, CDS_spread_returns_Germany)
t2 = cbind(1:1655, CDS_spread_returns_France)
wtc.AB = wtc(t1, t2, nrands = 20)
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(wtc.AB, plot.phase = TRUE, lty.coi = 1, col.coi = "grey", lwd.coi = 2,
lwd.sig = 2, arrow.lwd = 0.03, arrow.len = 0.12, ylab = "Period", xlab = "time",
plot.cb = TRUE, main = "Germany vs France", xaxt="n")
n = length(t1[, 1])
abline(v = seq(260, n, 260), h = 1:16, col = "brown", lty = 1, lwd = 1)
axis(side = 1, at = c(seq(0, n, 260)), labels = c(seq(2011, 2017, 1)))
Remember to download the "readxl" and "biwavelet" packages first.
I hope to find my video useful.
@ΔΗΜΗΤΡΙΟΣ ΔΗΜΗΤΡΙΟΥ @ProgrammingDDS @econometricsacademy @EconomicsExplained @markets @beCurious1 @mbaInternationalAUEB @aueb1920 @marinstatlectures
The best programme to run the WCA is the R Studio. Someone can download the programme from the following link (the R must already installed):
https://www.rstudio.com/products/rstu...
Some paper which use the wavelets techinque are:
https://www.sciencedirect.com/science...
https://www.sciencedirect.com/science...
https://www.sciencedirect.com/science...
The code that runs in the video is the following:
library(biwavelet)
attach(CDS_returns)
A=CDS_spread_returns_Germany
B=CDS_spread_returns_France
t1 = cbind(1:1655, CDS_spread_returns_Germany)
t2 = cbind(1:1655, CDS_spread_returns_France)
wtc.AB = wtc(t1, t2, nrands = 20)
par(oma = c(0, 0, 0, 1), mar = c(5, 4, 4, 5) + 0.1)
plot(wtc.AB, plot.phase = TRUE, lty.coi = 1, col.coi = "grey", lwd.coi = 2,
lwd.sig = 2, arrow.lwd = 0.03, arrow.len = 0.12, ylab = "Period", xlab = "time",
plot.cb = TRUE, main = "Germany vs France", xaxt="n")
n = length(t1[, 1])
abline(v = seq(260, n, 260), h = 1:16, col = "brown", lty = 1, lwd = 1)
axis(side = 1, at = c(seq(0, n, 260)), labels = c(seq(2011, 2017, 1)))
Remember to download the "readxl" and "biwavelet" packages first.
I hope to find my video useful.
@ΔΗΜΗΤΡΙΟΣ ΔΗΜΗΤΡΙΟΥ @ProgrammingDDS @econometricsacademy @EconomicsExplained @markets @beCurious1 @mbaInternationalAUEB @aueb1920 @marinstatlectures
2 سال پیش
در تاریخ 1401/03/30 منتشر شده
است.
10,613
بـار بازدید شده