R documentation updates

This commit is contained in:
Ben Letham 2019-05-13 15:47:28 -07:00
parent 526468b6e8
commit f09ad61c26
3 changed files with 38 additions and 30 deletions

View file

@ -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.

View file

@ -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}

View file

@ -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}