Last observation: 12 oct. 2026 (N = 129)
First observation: 25 déc. 1979 (N = 3)
Last data update: 12 oct. 2026, 06:30
Last compile: 12 oct. 2026, 06:36
bonds |>
group_by(symbol) |>
summarise(Nobs = n()) |>
arrange(-Nobs) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}bonds |>
group_by(symbol) |>
arrange(Date) |>
summarise(Date = last(Date),
Close = last(Close)) |>
arrange(desc(Date)) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}bonds |>
filter(Date == as.Date("2020-09-01"),
Close < 0) |>
select(bond = symbol, Close) |>
arrange(Close) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}i_g("bib/investing/bonds_ex1-bind.png")
bonds |>
filter(Date == as.Date("2020-12-15"),
grepl("Greece", symbol)) |>
select(Bond = symbol, `Dec 15, 2020` = Close) |>
arrange(`Dec 15, 2020`) |>
mutate(`Dec 15, 2020` = paste0(round(`Dec 15, 2020`, 3), "%")) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}i_g("bib/investing/bonds_ex2.png")
obligations <- c("France 10Y", "Germany 10Y", "Italy 10Y")
bonds |>
filter(symbol %in% obligations, Date >= as.Date("2000-01-01")) |>
ggplot() + geom_line(aes(x = Date, y = Close, color = symbol)) +
theme_minimal() + xlab("") + ylab("Taux 10 ans (%)") +
scale_x_date(breaks = seq(1960, 2100, 4) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_color_flag(obligations) +
theme(legend.position = c(0.2, 0.85), legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 30Y", "Italy 30Y", "France 30Y", "U.S. 30Y"),
Date >= as.Date("2020-04-01")) |>
ggplot() + geom_line(aes(x = Date, y = Close/100, color = symbol)) +
theme_minimal() + xlab("") + ylab("30-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 1) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 0.2),
labels = percent_format(accuracy = 0.1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.3),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Germany 20Y", "Germany 30Y"),
Date >= as.Date("2019-10-01")) |>
ggplot() + geom_line(aes(x = Date, y = Close/100, color = symbol, linetype = symbol)) +
theme_minimal() + xlab("") + ylab("Germany Government Bonds (%)") +
scale_x_date(breaks = seq(1960, 2100, 1) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 0.2),
labels = percent_format(accuracy = 0.1)) +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.position = c(0.7, 0.2),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Netherlands 10Y", "France 10Y")) |>
select(symbol, Date, Close) |>
ggplot() + geom_line(aes(x = Date, y = Close/100, color = symbol)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2014-01-01")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year (%)") +
scale_x_date(breaks = seq(1960, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.5, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2010-09-01")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year (%)") +
scale_x_date(breaks = seq(1960, 2100, 2) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.5, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2005-01-01")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 1) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "U.S. 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "U.S. 10Y", "Spain 10Y"),
Date >= as.Date("2022-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("2000-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "2 years",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 70, 2),
labels = percent_format(accuracy = 1)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y", "U.S. 10Y"),
Date >= as.Date("2019-07-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_6flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y", "U.S. 10Y"),
Date >= as.Date("2020-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_6flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "U.S. 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y", "U.S. 10Y"),
Date >= as.Date("2020-01-01"),
Date <= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield, 2020 (%)") +
scale_x_date(breaks = "1 month",
labels = date_format("%b")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_6flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y"),
Date >= as.Date("2012-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
select(-symbol) |>
spread(Location, obsValue) |>
transmute(date,
France = France - Germany,
Greece = Greece - Germany,
Italy = Italy - Germany,
Spain = Spain - Germany) |>
gather(Location, obsValue, -date) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("Spreads (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 60, 2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
select(-symbol) |>
spread(Location, obsValue) |>
transmute(date,
France = France - Germany,
Greece = Greece - Germany,
Italy = Italy - Germany,
Spain = Spain - Germany) |>
gather(Location, obsValue, -date) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("Spreads (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("1995-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "2 years",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 70, 1),
labels = percent_format(accuracy = 1)) +
scale_color_identity() + add_4flags +
geom_vline(xintercept = as.Date("2012-07-26"), linetype = "dashed", color = "black")
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("2005-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "2 years",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 70, 1),
labels = percent_format(accuracy = 1)) +
scale_color_identity() + add_4flags +
geom_vline(xintercept = as.Date("2012-07-26"), linetype = "dashed", color = "black")
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("2010-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "2 years",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 70, 1),
labels = percent_format(accuracy = 1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank()) +
geom_vline(xintercept = as.Date("2012-07-26"), linetype = "dashed", color = "black")
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "U.S. 10Y"),
Date >= as.Date("2019-07-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .5),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "U.S. 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_5flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "U.K. 10Y", "France 10Y", "U.S. 10Y"),
Date >= as.Date("1995-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location),
Location = ifelse(Location == "U.K.", "United Kingdom", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = Location)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .5),
labels = percent_format(accuracy = .1)) +
scale_color_manual(values = c("#002395", "#FFCE00", "#CF142B", "#3C3B6E")) +
theme(legend.position = c(0.7, 0.8),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "U.K. 10Y", "France 10Y", "U.S. 10Y"),
Date >= as.Date("2017-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location),
Location = ifelse(Location == "U.K.", "United Kingdom", Location)) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .5),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("2019-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
select(-symbol) |>
spread(Location, obsValue) |>
transmute(date,
France = France - Germany,
Italy = Italy - Germany,
Spain = Spain - Germany) |>
gather(Location, obsValue, -date) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("Spreads (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 60, .5),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_3flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y"),
Date >= as.Date("2010-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
select(-symbol) |>
spread(Location, obsValue) |>
transmute(date,
France = France - Germany,
Italy = Italy - Germany,
Spain = Spain - Germany) |>
gather(Location, obsValue, -date) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("Spreads (%)") +
scale_x_date(breaks = "2 years",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 60, 1),
labels = percent_format(accuracy = 1)) +
scale_color_identity() + add_3flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank()) +
geom_vline(xintercept = as.Date("2012-07-26"), linetype = "dashed", color = "grey")
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y", "France 10Y", "Spain 10Y", "Greece 10Y"),
Date >= as.Date("2021-01-01")) |>
select(symbol, date = Date, obsValue = Close) |>
mutate(obsValue = obsValue/100) |>
mutate(Location = gsub(" 10Y", "", symbol),
Location = ifelse(Location == "U.S.", "United States", Location)) |>
select(-symbol) |>
spread(Location, obsValue) |>
transmute(date,
France = France - Germany,
Greece = Greece - Germany,
Italy = Italy - Germany,
Spain = Spain - Germany) |>
gather(Location, obsValue, -date) |>
add_flag_color("Location") |>
ggplot() + geom_line(aes(x = date, y = obsValue, color = color)) +
theme_minimal() + xlab("") + ylab("Spreads (%)") +
scale_x_date(breaks = "1 year",
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, .2),
labels = percent_format(accuracy = .1)) +
scale_color_identity() + add_4flags +
theme(legend.position = c(0.2, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2012-01-01"),
Date <= as.Date("2014-01-01")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks ="3 months",
labels = date_format("%b %Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2020-02-26"),
Date <= as.Date("2020-03-30")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks ="6 days",
labels = date_format("%b %d")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.15, 0.9),
legend.title = element_blank()) +
geom_vline(xintercept = as.Date("2020-03-12"), linetype = "dashed", color = "black")
bonds |>
filter(symbol %in% c("Germany 10Y", "Italy 10Y"),
Date >= as.Date("2020-02-24")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `Italy 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks = seq(1960, 2100, 1) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 1),
labels = percent_format(accuracy = 1)) +
scale_color_manual(values = viridis(5)[1:4]) +
theme(legend.position = c(0.8, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "France 10Y"),
Date >= as.Date("2017-03-01"),
Date <= as.Date("2017-05-15")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `France 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks ="10 days",
labels = date_format("%b %d")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 0.1),
labels = percent_format(accuracy = .1)) +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.position = c(0.85, 0.9),
legend.title = element_blank())
bonds |>
filter(symbol %in% c("Germany 10Y", "France 10Y"),
Date >= as.Date("2016-09-15"),
Date <= as.Date("2017-05-15")) |>
select(symbol, Date, Close) |>
spread(symbol, Close) |>
mutate(`Spread` = `France 10Y` - `Germany 10Y`) |>
gather(variable, value, -Date) |>
ggplot() + geom_line(aes(x = Date, y = value/100, color = variable)) +
theme_minimal() + xlab("") + ylab("10-Year Yield (%)") +
scale_x_date(breaks ="1 month",
labels = date_format("%b %Y")) +
scale_y_continuous(breaks = 0.01*seq(-10, 30, 0.1),
labels = percent_format(accuracy = .1)) +
scale_color_manual(values = viridis(4)[1:3]) +
theme(legend.position = c(0.15, 0.9),
legend.title = element_blank())
Proxy observable de la prime de terme : pente de la courbe = taux 10 ans \(-\) taux court (ce n’est pas une prime de terme « pure » de type ACM/Kim-Wright, qui retire les anticipations de taux). Taux court : 3 mois, à défaut 6 mois, 1 mois, 1 an ou 2 ans selon l’historique disponible.
term |>
group_by(country, short_mat) |>
summarise(Début = min(Date), Fin = max(Date),
`Taux court moyen (%)` = round(mean(short), 2),
`10 ans moyen (%)` = round(mean(long), 2),
`Prime de terme moyenne (pp)` = round(mean(term), 2),
`Depuis 2003 (pp)` = round(mean(term[Date >= as.Date("2003-01-06")]), 2),
`Dernière (pp)` = round(last(term[order(Date)]), 2), .groups = "drop") |>
rename(Pays = country, `Taux court` = short_mat) |>
arrange(desc(`Prime de terme moyenne (pp)`)) %>%
{if (is_html_output()) datatable(., filter = 'top', rownames = F) else .}cs <- term |> filter(Date >= as.Date("2003-01-06")) |>
group_by(country) |> filter(n() >= 5 * 250) |>
summarise(short = mean(short), long = mean(long), term = mean(term), .groups = "drop")
tibble(`N pays` = nrow(cs),
`Corr. court ~ prime de terme` = round(cor(cs$short, cs$term), 2),
`Pente de 10 ans sur court` = round(coef(lm(long ~ short, cs))[2], 2)) |>
print_table_conditional()| N pays | Corr. court ~ prime de terme | Pente de 10 ans sur court |
|---|---|---|
| 65 | 0.21 | 1.07 |
ggplot(cs, aes(x = short, y = term)) +
geom_smooth(method = "lm", se = FALSE, color = "grey60", linewidth = 0.6) +
geom_point(color = viridis(3)[1]) +
ggrepel::geom_text_repel(aes(label = country), size = 3, max.overlaps = 30) +
theme_minimal() + labs(x = "Taux court moyen (%), depuis 2003", y = "10 ans $-$ court (pp)")
major <- c("U.S.", "Germany", "France", "U.K.", "Canada", "Switzerland", "Japan")
term |> filter(country %in% major, Date >= as.Date("1990-01-01")) |>
ggplot() + geom_line(aes(x = Date, y = term, color = country)) +
geom_hline(yintercept = 0, linewidth = 0.3) +
theme_minimal() + xlab("") + ylab("10 ans $-$ court (pp)") +
scale_x_date(breaks = seq(1960, 2100, 5) |> paste0("-01-01") |> as.Date(),
labels = date_format("%Y")) +
scale_color_flag(major) +
theme(legend.position = c(0.15, 0.85), legend.title = element_blank())