View source: R/network.interpolation.R
| plot.network_interpolation | R Documentation |
S3 plot method for objects returned by
network.interpolation.
Depending on type, the method can display:
interpolated series through time,
uncertainty width,
reference-network availability,
summary diagnostics,
synthetic-gap validation metrics,
interval coverage,
actual versus interpolated validation points,
seasonal validation diagnostics.
Jump-corrected post-gap points are marked in the interpolation plot when
jump correction was enabled in network.interpolation.
## S3 method for class 'network_interpolation'
plot(
x,
type = c("interpolation", "uncertainty", "availability", "summary", "validation",
"coverage", "compare", "seasonal_error"),
series = NULL,
start = NULL,
end = NULL,
show_pi = TRUE,
show_fit = FALSE,
free_y = TRUE,
ncol = 1,
summary_metric = c("n_imputed", "n_remaining_na", "n_missing_input", "mean_pi_width",
"median_pi_width", "mean_ref_n", "median_ref_n", "n_gap_jumps_removed",
"max_abs_gap_jump"),
validation_metric = c("MAE", "MAPE", "MdAPE", "RMSE", "Bias", "Success_rate",
"Mean_PI_width", "Mean_ref_n", "End_value_abs_diff", "Max_abs_diff_within_gap"),
seasonal_metric = c("mean_error", "mean_abs_error", "mean_abs_pct_error", "rmse",
"coverage"),
compare_colour = c("series", "gap_steps"),
facet = TRUE,
empty = c("plot", "error"),
...
)
x |
Object returned by |
type |
Character. Plot type. One of |
series |
Optional character vector of focal series names to plot. |
start |
Optional start datetime for time-based plots. |
end |
Optional end datetime for time-based plots. |
show_pi |
Logical. If |
show_fit |
Logical. If |
free_y |
Logical. If |
ncol |
Integer. Number of facet columns. |
summary_metric |
Character metric used when
|
validation_metric |
Character metric used when
|
seasonal_metric |
Character metric used when
|
compare_colour |
Character. Colouring used when
|
facet |
Logical. If |
empty |
Character. Behavior when no suitable data are available:
|
... |
Further arguments passed through the generic. |
Plot types:
"interpolation"Shows original and interpolated focal series through time. Imputed points are highlighted. If jump correction was applied, corrected post-gap points are marked in green.
"uncertainty"Shows the width of the prediction interval through time.
"availability"Shows the number of valid reference sensors available at each step.
"summary"Shows per-series summary diagnostics produced by the interpolation run.
"validation"Shows synthetic-gap recovery metrics across tested gap lengths.
"coverage"Shows how often true values fall inside the nominal 95% prediction interval across gap lengths.
"compare"Scatter plot of actual versus interpolated values from synthetic-gap validation.
"seasonal_error"Shows how validation error varies through the season, summarized by day of year.
Validation-based plots require that
network.interpolation(..., assess = TRUE) was used to create
x.
A ggplot2 object.
network.interpolation
#library(dendRoAnalyst)
#data("gf_nepa17")
#df1 <- gf_nepa17
#df1[40:50, "T2"] <- NA
#ref <- cbind(gf_nepa17, gf_nepa17[, 2:3], gf_nepa17[, 2:3])
#colnames(ref) <- c("Time", "T1", "T2", "T3", "T4", "T5", "T6")
#out <- network.interpolation(
# df1, ref,
# niMethod = "proportional",
# n_boot = 100,
# assess = TRUE,
# assess_lengths_steps = c(1, 2, 4),
# correct_gap_jumps = TRUE,
# jump_threshold = 0.05
#)
#plot(out)
#plot(out, type = "uncertainty")
#plot(out, type = "availability")
#plot(out, type = "summary", summary_metric = "n_gap_jumps_removed")
#plot(out, type = "validation", validation_metric = "MAPE")
#plot(out, type = "coverage")
#plot(out, type = "compare")
#plot(out, type = "seasonal_error", seasonal_metric = "mean_abs_error")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.