t_oos_mc: Time-wise Monte Carlo

Description Usage Arguments Value

View source: R/methods.R

Description

Performs a time-wise Monte Carlo experiment where split points are randomly chosen and a window of previous observations are used for training, with a window of following observations used for testing.

Usage

1
2
t_oos_mc(data, tr.perc, ts.perc, nreps, FUN, form, time = "time",
  site_id = "site", .keepTrain = TRUE, ...)

Arguments

data

full dataset

tr.perc

percentage of data used for training. Remaining will be used for testing

ts.perc

percentage of data used for testing

nreps

number of repetitions/split-points in experiment

FUN

function with arguments

  • train training set

  • test testing set

  • time column name of time-stamps

  • site_id column name of location identifiers

  • form a formula for model learning

  • ... other arguments

form

a formula for model learning

time

column name of time-stamp in data. Default is "time"

site_id

column name of location identifier in data. Default is "site_id"

.keepTrain

if TRUE (default), instead of the results of FUN being directly returned, a list is created with both the results and a data.frame with the time and site identifiers of the observations used in the training step.

...

other arguments to FUN

Value

If keepTrain is TRUE, a list where each slot corresponds to one repetition or fold, containing a list with slots results containing the results of FUN, and train containing a data.frame with the time and site_id identifiers of the observations used in the training step. Usually, the results of FUN is a data.frame with location identifier site_id, time-stamp time, true values trues and the workflow's predictions preds.


mrfoliveira/Evaluation-procedures-for-forecasting-with-spatio-temporal-data documentation built on April 11, 2021, 10:50 a.m.