diff --git a/R/man/performance_metrics.Rd b/R/man/performance_metrics.Rd index 435ffcd..8bd8ed9 100644 --- a/R/man/performance_metrics.Rd +++ b/R/man/performance_metrics.Rd @@ -13,7 +13,7 @@ performance_metrics(df, metrics = NULL, rolling_window = 0.1) will use c('mse', 'rmse', 'mae', 'mape', 'coverage').} \item{rolling_window}{Proportion of data to use in each rolling window for -computing the metrics. Should be in [0, 1].} +computing the metrics. Should be in [0, 1] to average.} } \value{ A dataframe with a column for each metric, and column 'horizon'. @@ -32,14 +32,18 @@ A subset of these can be specified by passing a list of names as the `metrics` argument. Metrics are calculated over a rolling window of cross validation -predictions, after sorting by horizon. The size of that window (number of -simulated forecast points) is determined by the rolling_window argument, -which specifies a proportion of simulated forecast points to include in -each window. rolling_window=0 will compute it separately for each simulated -forecast point (i.e., 'mse' will actually be squared error with no mean). -The default of rolling_window=0.1 will use 10% of the rows in df in each -window. rolling_window=1 will compute the metric across all simulated -forecast points. The results are set to the right edge of the window. +predictions, after sorting by horizon. Averaging is first done within each +value of the horizon, and then across horizons as needed to reach the +window size. The size of that window (number of simulated forecast points) +is determined by the rolling_window argument, which specifies a proportion +of simulated forecast points to include in each window. rolling_window=0 +will compute it separately for each horizon. The default of +rolling_window=0.1 will use 10% of the rows in df in each window. +rolling_window=1 will compute the metric across all simulated forecast +points. The results are set to the right edge of the window. + +If rolling_window < 0, then metrics are computed at each datapoint with no +averaging (i.e., 'mse' will actually be squared error with no mean). The output is a dataframe containing column 'horizon' along with columns for each of the metrics computed. diff --git a/R/man/rolling_mean.Rd b/R/man/rolling_mean.Rd deleted file mode 100644 index b422503..0000000 --- a/R/man/rolling_mean.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/diagnostics.R -\name{rolling_mean} -\alias{rolling_mean} -\title{Compute a rolling mean of x} -\usage{ -rolling_mean(x, w) -} -\arguments{ -\item{x}{Array.} - -\item{w}{Integer window size (number of elements).} -} -\value{ -Rolling mean of x with window size w. -} -\description{ -Right-aligned. Padded with NAs on the front so the output is the same -size as x. -} -\keyword{internal} diff --git a/R/man/rolling_mean_by_h.Rd b/R/man/rolling_mean_by_h.Rd new file mode 100644 index 0000000..4215139 --- /dev/null +++ b/R/man/rolling_mean_by_h.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/diagnostics.R +\name{rolling_mean_by_h} +\alias{rolling_mean_by_h} +\title{Compute a rolling mean of x, after first aggregating by h} +\usage{ +rolling_mean_by_h(x, h, w, name) +} +\arguments{ +\item{x}{Array.} + +\item{h}{Array of horizon for each value in x.} + +\item{w}{Integer window size (number of elements).} + +\item{name}{String name for metric in result dataframe.} +} +\value{ +Dataframe with columns horizon and name, the rolling mean of x. +} +\description{ +Right-aligned. Computes a single mean for each unique value of h. Each mean +is over at least w samples. +} +\keyword{internal}