flagged_mps_table <- readRDS(file = paste0(dir, "/data/rdata/flagged_mps_table.Rda"))
flagged_milestones_mps <- readRDS(file = paste0(dir, "/data/rdata/flagged_milestones_mps.Rda"))
flagged_iprp_end_mps <- readRDS(file = paste0(dir, "/data/rdata/flagged_iprp_end_mps.Rda"))
watch_mps <- readRDS(file = paste0(dir, "/data/rdata/watch_mps.Rda"))
flagged_mps_data_melt <- readRDS(file = paste0(dir, "/data/rdata/flagged_mps_data_melt.Rda"))
IPRP_plans_melt_mps <- readRDS(file = paste0(dir, "/data/rdata/IPRP_plans_melt_mps.Rda"))
watch_mps_melt <- readRDS(file = paste0(dir, "/data/rdata/watch_mps_melt.Rda"))
mps_summary_melt <- readRDS(file = paste0(dir, "/data/rdata/mps_summary_melt.Rda"))
iprp_plan_comparison_mps <- readRDS(file = paste0(dir, "/data/rdata/iprp_plan_comparison_mps.Rda"))
iprp_status_mps <- readRDS(file = paste0(dir, "/data/rdata/iprp_status_mps.Rda"))

\newpage

Summary of Performance and MOSL Actions

Overview

There were r nrow(flagged_mps_table) flags for performance issues this month, including r nrow(flagged_mps_table[flagged_mps_table$Watch_list == "Yes",]) issues that were flagged because they were on the Watch-list. These flags cover r NROW(unique(flagged_mps_table$Trading.Party.ID)) Trading Parties and the following Market Performance Standards: r unique(flagged_mps_table$MPS). Of the r nrow(flagged_mps_table[flagged_mps_table$Watch_list == "No",]) performance issues not already on the watch-list:

Of the r nrow(unique(flagged_mps_table[flagged_mps_table$Watch_list == "Yes",])) performance issues on the MPS Watch-list this month:

There were r nrow(flagged_milestones_mps[flagged_milestones_mps$Watch_list == "No",]) IPRPs flagged for performance being more than 5% below the planned milestone. Of these:

There were r nrow(flagged_milestones_mps[flagged_milestones_mps$Watch_list == "Yes",]) IPRP(s) on the Watch-list. Of these:

There were r nrow(flagged_iprp_end_mps) IPRP(s) that reached the end of their plans this month. Of these:

The tables below summarise the monthly performance triggers and the IPRP milestone flags with the corresponding MOSL actions and rationale.

Monthly performance flags and watch-list

kableExtra::kable(
  flagged_mps_table, 
  format = "latex", 
  caption = "Trading Parties flagged for below peer performance",
  col.names = c(
    "Trading Party", 
    "MPS", 
    "Action", 
    "Rationale", 
    "Watch"
    ),
  longtable = TRUE, 
  booktabs = TRUE,
  linesep = ""
  ) %>%
  kableExtra::kable_styling(
    font_size = 10,
    latex_options = c(
      "repeat_header",
      "hold_position",
      "striped",
      position = "center", 
      full_width = FALSE)
    ) %>%
  kableExtra::column_spec(4, width = "8.5cm") %>%
  kableExtra::row_spec(0, bold = TRUE)

IPRP milestone triggers and watch-list

kableExtra::kable(
  flagged_milestones_mps %>%
    dplyr::select(Trading.Party.ID, MPS, Batch, Action, Rationale), 
  format = "latex", 
  caption = "IPRPs flagged for performance below monthly milestone",
  col.names = c(
    "Trading Party",
    "MPS",
    "Batch",
    "Action",
    "Rationale"
    ),
  longtable = TRUE,
  booktabs = TRUE,
  linesep = ""
  ) %>%
  kableExtra::kable_styling(
    font_size = 10,
    latex_options = c(
      "repeat_header",
      "hold_position",
      "striped",
      position = "center",
      full_width = FALSE)
    ) %>%
  kableExtra::column_spec(5, width = "7cm")%>%
  kableExtra::row_spec(0, bold = TRUE)

End of IPRPs

kableExtra::kable(
  flagged_iprp_end_mps %>%
      dplyr::select(Trading.Party.ID, MPS, Batch, Action, Rationale), 
  format = "latex", 
  caption = "IPRPs that have reached the end of their plans",
  col.names = c(
    "Trading Party",
    "MPS",
    "Batch",
    "Action",
    "Rationale"
    ),
  longtable = TRUE,
  booktabs = TRUE,
  linesep = ""
  ) %>%
  kableExtra::kable_styling(
    font_size = 10,
    latex_options = c(
      "repeat_header",
      "hold_position",
      "striped",
      position = "center",
      full_width = FALSE)
    ) %>%
  kableExtra::column_spec(5,width = "7cm")%>%
  kableExtra::row_spec(0, bold = TRUE)

Watch-list

The two tables below show the Trading Parties that were on watch prior to this month's actions.

MPS

There are currently r nrow(watch_mps) Trading Parties on watch for MPS performance.

if (nrow(watch_mps) > 0) {

  kableExtra::kable(
    watch_mps, 
    format = "latex", 
    caption = "Trading Parties on watch for MPS performance",
    col.names = c(
      "Trading Party", "MPS"),
    longtable = TRUE, 
    booktabs=TRUE,
    linesep=""
      ) %>%
    kableExtra::kable_styling(
      latex_options = c(
        "repeat_header",
        "hold_position",
        "striped",
        position = "center", 
        full_width = FALSE)
      ) %>%
    kableExtra::row_spec(0, bold = TRUE)

}

\pagebreak

Performance Graphs

Monthly Performance Triggers (flagged Trading Parties only)

Below are graphs for those Trading Parties flagged for below-peer performance by MPS, as indicated in Table 1 above.

flagged_labels <- c("Task Completion (RHS)","Mean (RHS)","Median (RHS)","Task Share (RHS)")

##producing the MPS flagged graphs as list then using marrangeGrob

plist_flagged = lapply(split(flagged_mps_data_melt, flagged_mps_data_melt$key), function(z) {

  data <- z

  plot <- ggplot2::ggplot(data) + 
    ggplot2::geom_bar(
      ggplot2::aes(
        x = Date, 
        y = TaskVolume, 
        fill = "Task Volume (LHS)"
        ), 
      stat = "identity", 
      position = "dodge", 
      inherit.aes = FALSE
      ) +
    ggplot2::geom_line(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TaskVolume), 
        colour = variable, 
        linetype = variable, 
        size = variable
        )
      ) + 
    ggplot2::scale_y_continuous(
      sec.axis = ggplot2::sec_axis(~ . / max(data$TaskVolume), name = "Proportion")
      ) +
    ggplot2::scale_fill_manual(
      NULL, values = "azure3", na.value = "red"
      ) +
    ggplot2::scale_size_manual(
      values = c(1,0.5,0.5,0.5), 
      na.value = "1", 
      labels = flagged_labels
      ) +
    ggplot2::scale_linetype_manual(
      values = c(1,2,1,3), 
      na.value = "1", 
      labels = flagged_labels
      ) +
    ggplot2::scale_colour_manual(
      values = c("darkorange", "azure4", "dodgerblue4","grey3"), 
      na.value = "red", 
      labels = flagged_labels
      ) +
    ggplot2::ylab("Volume of tasks") + ggplot2::xlab("Date") +
    ggplot2::theme(
      legend.title = ggplot2::element_blank(), 
      legend.position = "right") +
    ggplot2::ggtitle(paste(Trading.Party.ID, " (", MPS, ")", sep = ""))

  }
)

gridExtra::marrangeGrob(plist_flagged,top=NULL,nrow=1,ncol=1)

\pagebreak

IPRP Performance Comparison (all plans)

The graphs below depict the performance of each IPRP against its planned milestones, including--but not limited to--those flagged for below-planned performance (as indicated in Table 2).

# Producing the graphs as list then using marrangeGrob to plot them separately --------------------------------------------------------------------------------------------------------------------------------------------------------------------

iprp_labels <- c("Task Completion (RHS)", "Mean (RHS)", "Median (RHS)", "Task Share (RHS)", "Planned Perf (RHS)")

plist_IPRP = lapply(split(IPRP_plans_melt_mps, IPRP_plans_melt_mps$key), function(data) {

  plot <- ggplot2::ggplot(data) + 
    ggplot2::geom_bar(
      ggplot2::aes(
        x = Date, 
        y = TaskVolume, 
        fill = "Task Volume (LHS)"), 
      stat = "identity", 
      position = "dodge", 
      inherit.aes = FALSE
      ) +
    ggplot2::geom_line(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TaskVolume), 
        colour = variable, 
        linetype = variable, 
        size = variable
        )
      ) + 
    ggplot2::geom_point(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TaskVolume), 
        shape = variable, 
        alpha = variable
        )
      ) +
    ggplot2::scale_y_continuous(
      sec.axis = ggplot2::sec_axis(~. / max(data$TaskVolume), name = "Proportion")
      ) +
    ggplot2::scale_fill_manual(
      NULL, 
      values = "azure3", 
      na.value = "red"
      ) +
    ggplot2::scale_size_manual(
      values = c(1, 0.5, 0.5, 0.5, 1), 
      na.value = "1", 
      labels = iprp_labels
      ) +
    ggplot2::scale_linetype_manual(
      values = c(1, 2, 1, 3, 1), 
      na.value = "1", 
      labels = iprp_labels
      ) +
    ggplot2::scale_colour_manual(
      values = c("darkorange", "azure4", "dodgerblue4", "grey3", "red"), 
      na.value="red", 
      labels = iprp_labels
      ) +
    ggplot2::scale_shape_manual(
      values = c(0, 0, 0, 0, 1), 
      na.value = 0, 
      labels = iprp_labels
      ) +
    ggplot2::scale_alpha_manual(
      values = c(0, 0, 0, 0, 1), 
      na.value = 0, 
      labels = iprp_labels
      ) +
    ggplot2::ylab("Volume of tasks") + ggplot2::xlab("Date") +
    ggplot2::theme(
      legend.title = ggplot2::element_blank(), 
      legend.position = "right"
      ) +
    ggplot2::ggtitle(
      paste0(
        "Batch ", 
        max(as.numeric(data$Batch), na.rm = TRUE), ": ", data$Trading.Party.ID, "  (", data$MPS, ")")
      )

  }
)

gridExtra::marrangeGrob(plist_IPRP, top = NULL, nrow = 1, ncol = 1)

Watch-list

The graphs below depict the performance of issue(s) on the watch-list (not including IPRPs).

watch_labels <- c("Task Completion (RHS)", "Mean (RHS)", "Median (RHS)", "Task Share (RHS)")

plist_watch = lapply(split(watch_mps_melt, watch_mps_melt$key), function(data) {

  plot <- ggplot2::ggplot(data) + 
    ggplot2::geom_bar(
      ggplot2::aes(
        x = Date, 
        y = TaskVolume, 
        fill = "Task Volume (LHS)"
        ), 
      stat = "identity", 
      position = "dodge", 
      inherit.aes = FALSE
      ) +
    ggplot2::geom_line(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TaskVolume), 
        colour = variable, 
        linetype = variable, 
        size = variable)
      ) + 
    ggplot2::geom_point(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TaskVolume), 
        shape = variable, 
        alpha = variable)
      ) +
    ggplot2::scale_y_continuous(
      sec.axis = ggplot2::sec_axis(~. / max(data$TaskVolume), name = "Proportion")
      ) +
    ggplot2::scale_fill_manual(
      NULL, 
      values = "azure3", 
      na.value = "red"
      ) +
    ggplot2::scale_size_manual(
      values = c(1, 0.5, 0.5, 0.5, 1), 
      na.value = "1", 
      labels = iprp_labels
      ) +
    ggplot2::scale_linetype_manual(
      values = c(1, 2, 1, 3, 1), 
      na.value = "1", 
      labels = iprp_labels
      ) +
    ggplot2::scale_colour_manual(
      values = c("darkorange", "azure4", "dodgerblue4", "grey3", "red"), 
      na.value = "red", 
      labels = iprp_labels
      ) +
    ggplot2::scale_shape_manual(
      values = c(0, 0, 0, 0, 1), 
      na.value = 0, 
      labels = iprp_labels
      ) +
    ggplot2::scale_alpha_manual(
      values = c(0, 0, 0, 0, 1), 
      na.value = 0, 
      labels = iprp_labels
      ) +
    ggplot2::ylab("Volume of tasks") + ggplot2::xlab("Date") +
    ggplot2::theme(
      legend.title = ggplot2::element_blank(), 
      legend.position = "right"
      ) +
    ggplot2::ggtitle(paste0(data$Trading.Party.ID,"  (", data$MPS, ")"))

  }
)

gridExtra::marrangeGrob(plist_watch, top = NULL, nrow = 1, ncol = 1)

Aggregated MPS

The graphs below show the aggregated performance for each MPS.

label_agg <- c("Mean (RHS)","Median (RHS)")

plist_mps_agg = lapply(split(mps_summary_melt, mps_summary_melt$MPS), function(data) {

  ggplot2::ggplot(data) +
    ggplot2::geom_bar(
      ggplot2::aes(
        x = Date, 
        y = TotalTaskVolume, 
        fill = "Task Volume (LHS)"), 
      stat = "identity", 
      position = "dodge", 
      inherit.aes = FALSE
      ) +
    ggplot2::geom_line(
      ggplot2::aes(
        x = Date, 
        y = value * max(data$TotalTaskVolume), 
        colour = variable, 
        linetype = variable)
      ) +
    ggplot2::scale_y_continuous(
      sec.axis = ggplot2::sec_axis(~. / max(data$TotalTaskVolume), name = "Proportion")
      ) +
    ggplot2::scale_fill_manual(
      NULL, values = "azure3"
      ) +
    ggplot2::scale_linetype_manual(
      values = c(2,1), 
      labels = label_agg
      ) +
    ggplot2::scale_colour_manual(
      values = c("azure4", "dodgerblue4"), 
      labels = label_agg
      ) +
    ggplot2::ylab("Volume of tasks") + ggplot2::xlab("Date") +
    ggplot2::theme(
      legend.title = ggplot2::element_blank(), 
      legend.position = "right"
      ) +
    ggplot2::ggtitle(paste(data$MPS))

  }
)

gridExtra::marrangeGrob(plist_mps_agg, top = NULL, nrow = 1, ncol = 1)

\newpage

IPRP Analytics

IPRP Performance: Delta to Plan and Market Level

The graphs below give an indication of whether, overall, Trading Parties are meeting or exceeding their IPRP milestone targets (left-hand side graph); and an indication of whether performance, overall, is converging with peer-level performance. The graphs are a general guide only, as the data is aggregated across all plans.

plott1 <- iprp_plan_comparison_mps %>%
  dplyr::filter(Date <= Sys.Date()) %>%
  dplyr::group_by(Date) %>%
  dplyr::summarise(mean_delta = mean(Delta, na.rm = TRUE)) %>%
  ggplot2::ggplot(
    ggplot2::aes(
      x = Date, 
      y = mean_delta)
    ) + 
  ggplot2::geom_line() + 
  ggplot2::geom_point() + 
  ggplot2::ylab("Mean Difference") + ggplot2::xlab("Date") +
  geom_label(
    ggplot2::aes(
      label = format(round(mean_delta, 2), nsmall = 2))
    ) + 
  ggplot2::ggtitle("All batches: mean difference between \n actual and planned performance")

plott2 <- iprp_plan_comparison_mps %>%
  dplyr::filter(Date <= Sys.Date()) %>%
  dplyr::mutate(delta_to_mean = TaskCompletion - MPS_Mean) %>%
  dplyr::group_by(Date) %>%
  dplyr::summarise(mean_delta_to_mean = mean(delta_to_mean, na.rm = TRUE)) %>%
  ggplot2::ggplot(
    ggplot2::aes(
      x = Date, 
      y = mean_delta_to_mean)
    ) + 
  ggplot2::geom_line() + 
  ggplot2::geom_point() + 
  ggplot2::ylab("Delta to the Market MPS level") + ggplot2::xlab("Date") +
  geom_label(
    ggplot2::aes(
      label = format(round(mean_delta_to_mean, 2 ), nsmall = 2))
    ) +
  ggplot2::ggtitle("All batches: mean difference between \n performance and market MPS level")

plot_list = c(plott1,plott2)

g <- gridExtra::arrangeGrob(plott1, plott2, nrow = 1, ncol = 2)

plot(g)

\newpage

Current Status of IPRPs

The current status of each IPRP is shown in the table below.

kableExtra::kable(
  iprp_status_mps, 
  format = "latex", 
  caption = "Current status of IPRP(s)", 
  col.names = c(
    "Trading Party",
    "MPS", 
    "Batch", 
    "Actual Perf.", 
    "Planned Perf.", 
    "Status"), 
  longtable = TRUE, 
  booktabs = TRUE, 
  linesep = ""
  ) %>%
  kableExtra::kable_styling(
    latex_options = 
      c(
        "repeat_header",
        "hold_position",
        "striped",
        position= "center", 
        full_width = TRUE
        )
    ) %>%
  kableExtra::row_spec(0, bold = TRUE)

The graphs below depict the changes in status of IPRPs (on-track, close and off-track).

ploty <- iprp_plan_comparison_mps %>%
  dplyr::select(
    Date, OnTrack, Close, OffTrack, Batch
    ) %>%
  tidyr::gather(key = "variable", value = "value", OnTrack, Close, OffTrack) %>%
  dplyr::mutate(
    variable2 = factor(variable, levels = c("OffTrack", "Close", "OnTrack"))
  ) %>%
  ggplot2::ggplot(
    ggplot2::aes(
      x = Date, 
      y = value, 
      fill = variable2)
    ) + 
  ggplot2::geom_bar(stat = "identity") +
  labs(
    title = "IPRP Performance",
    subtitle = "Count of active plans by month and status"
    ) +
  ggplot2::ylab("Count of plans by status") + ggplot2::xlab("") +
  ggplot2::theme_minimal(base_size = 11) +
  ggplot2::scale_fill_manual(values = c("darkorange", "azure3", "dodgerblue4")) +
  ggplot2::theme(
    legend.position = "top", 
    legend.title = ggplot2::element_blank()
    )

plot(ploty)


austl001/MOSLR documentation built on Aug. 17, 2022, 12:07 a.m.