sheilasaia / paper-ndfd-nccoast-study

Analysis associated with ndfd shellcast paper.
1 stars 0 forks source link

calculate error statistics #20

Closed nataliegnelson closed 3 years ago

nataliegnelson commented 3 years ago

Hi Sheila,

Could you please calculate the R2 (coefficient of determination) and RMSE for each of the valid periods shown in the plot below?

obs_fore

In the paper, I'm thinking we can have the above plot alongside this one:

sim_fore_ml

Note that, in the figure above, I manually added the R2 and RMSE text boxes in powerpoint. Here's the code I used to create the plot (I pulled code from one of your scripts, but it looks slightly different than the original plot - I must have pulled the code for a different figure).

my_validhrs_colors <- c("#66c2a5", "#fc8d62", "#8da0cb")

ggplot(data = d) +
  geom_point(aes(x = precip_test*2.54, y = precip_pred*2.54, fill = as.factor(valid_period)), shape = 21, alpha = 0.50, size = 3) +
  geom_abline(slope = 1, intercept = 0, lty = 2) +
  facet_wrap(~ as.factor(valid_period)) +
  labs(x = "Forecasted (cm)", y = "Observed (cm)", fill = "Valid Period Hours") +
  theme_classic() +
  scale_fill_manual(values = my_validhrs_colors) +
  theme(axis.text = element_text(size = 16),
        axis.title = element_text(size = 16),
        text = element_text(size = 16),
        panel.grid.major = element_blank(), 
        panel.grid.minor = element_blank(),
        panel.background = element_blank())
ggsave("sim_obs_ml.pdf", width = 12, height = 4, units = "in")
sheilasaia commented 3 years ago

Thanks @nataliegnelson! I didn't realize you manually added the R2 and RMSE. I'll try to work that into the code and ping you when I have it.