hpiR (version 0.2.0)

buildForecastIDs: Create the row IDs for forecast accuracy

Description

Generate a vector of row IDs for use in forecast accuracy tests

Usage

buildForecastIDs(time_cut, hpi_df, forecast_length = 1, train = TRUE)

Arguments

time_cut

Period after which to cut off data

hpi_df

Data to be converted to training or scoring

forecast_length

default = 1; Length of forecasting to do

train

Default=TRUE; Create training data? FALSE = Scoring data

...

Additional Arguments

Value

vector of row_ids indicating inclusion in the forecasting data as either the training set (train = TRUE) or the scoring set (train = FALSE)

Further Details

This function is rarely (if ever) used directly. Most often called by `calcForecastError()`

It is a generic method that dispatches on the `hpi_df` object.

Examples

Run this code
# NOT RUN {
  # Load example sales
 data(ex_sales)

 # Create RT data
 rt_data <- rtCreateTrans(trans_df = ex_sales,
                          prop_id = 'pinx',
                          trans_id = 'sale_id',
                          price = 'sale_price',
                          periodicity = 'monthly',
                          date = 'sale_date')

# Create ids
  fc_ids <- buildForecastIDs(time_cut = 27,
                             hpi_df = rt_data,
                             forecast_length = 2,
                             train = TRUE)

# }

Run the code above in your browser using DataLab