I have a ggplot for the different forecasts I used. Can you please help me add labels for the different forecasts? I pasted a copy of the code and a picture of the current graph. Don't mind the title, caption, and subtitle.
ggplot(Forecast_df, aes(date)) +
geom_tile(aes(alpha = Recession, y = 1),
fill = "grey", height = Inf) +
scale_alpha_continuous(range = c(0, 1), breaks = c(0, 1), labels = c("0" = "Expansion", "1" = "Recession"))+
geom_line(aes(y = ERVOLY), col = "black", size = .8)+
geom_line(aes(y = ERVOL_vanilla), col = "blue", size = .8)+
geom_line(aes(y = ERVOL_twofactor), col = "green", size = .8)+
geom_line(aes(y = ERVOL_threefactor), col = "orange", size = .8)+
ylab('Compounded Returns Next 12 Months (%)')+
labs(x = NULL, alpha = "Economic Cylcle", color = "Economic Variable",
title = "Rising Inflation Expectations in 2021",
caption = 'Cleveland Fed Model of 10-year Inflation Expectations',
subtitle = '"Directionality Matters"')+
theme(plot.background = element_blank(),
panel.grid.minor = element_blank(),
panel.grid.major= element_blank(),
text = element_text( color = "#003366"))
Here is a subset of the data (I hope this helps):
dput(head(Forecast_df, 10))
structure(list(INFEX = c(5.3755618, 5.2721824, 5.5661154, 5.407864,
5.4896902, 5.1106146, 4.5055244, 4.6342849, 4.5102793, 4.6395631
), ERVOLY = c(NA, -1.0061220776063, -3.28324764731475,
-2.69553459574718,
-0.282378595190325, 0.452399878131127, -1.98818474608972,
-2.02453229878801,
-2.93519956175393, -3.3615903958241), date = structure(c(6695,
6726, 6756, 6787, 6818, 6848, 6879, 6909, 6940, 6971), class =
"Date"),
Expansion = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1), Recession = c(0,
0, 0, 0, 0, 0, 0, 0, 0, 0), ERVOLY_lag1 = c(NA, NA, -1.0061220776063,
-3.28324764731475, -2.69553459574718, -0.282378595190325,
0.452399878131127, -1.98818474608972, -2.02453229878801,
-2.93519956175393), ERVOLY_lag2 = c(NA, NA, NA, -1.0061220776063,
-3.28324764731475, -2.69553459574718, -0.282378595190325,
0.452399878131127, -1.98818474608972, -2.02453229878801),
ERVOL_vanilla = c(NA, NA, NA, 0.177969523019507, 1.0226601086044,
2.95027193254105, 2.8634033844251, 0.549544852368316,
0.594205304832909,
-0.162404463789272), ERVOL_twofactor = c(NA, NA, NA,
0.0942849089685699,
0.91074093410051, 2.85616681306392, 2.81947921688057,
0.512592472075962,
0.537863435836189, -0.222954102109839), ERVOL_threefactor = c(NA,
NA, NA, -0.313401798360953, 0.474416484910883, 2.44479892124736,
2.49154716920072, 0.199652448822007, 0.23023289110162,
-0.537285874249354
), ERVOL_AR2 = c(NA, NA, NA, -3.24926540322977, -2.50081867707103,
-0.136146400989865, 0.424591722149989, -2.06171545794125,
-1.92397323156163, -2.82956410641666), fe_vanilla = c(NA,
NA, NA, -2.87350411876669, -1.30503870379473, -2.49787205440993,
-4.85158813051482, -2.57407715115632, -3.52940486658684,
-3.19918593203483), fe_twofactor = c(NA, NA, NA, -2.78981950471575,
-1.19311952929083, -2.4037669349328, -4.80766396297029,
-2.53712477086397,
-3.47306299759012, -3.13863629371426), fe_threefactor = c(NA,
NA, NA, -2.38213279738623, -0.756795080101207, -1.99239904311623,
-4.47973191529044, -2.22418474761001, -3.16543245285555,
-2.82430452157474), fe_AR2 = c(NA, NA, NA, 0.553730807482581,
2.21844008188071, 0.588546279120992, -2.41277646823971,
0.0371831591532463,
-1.0112263301923, -0.532026289407435)), row.names = c(NA,
10L), class = "data.frame")