st_lag_neib_ord1: Create a spatio-temporal embed of data

Description Usage Arguments Value See Also

View source: R/gen_data_utils.R

Description

Given spatio-temporal data, transform it into a data frame where each row has its own value as target variable and, as predictors, lagged values recorded in the past at its own location and/or in the past at neighbouring locations.

Usage

1
st_lag_neib_ord1(data, neibs, p, slags)

Arguments

data

a matrix of spatio-temporal data where each row contains the variable information for a time point and each column corresponds to a certain location

neibs

a data frame with information about the neighbours, like the one returned by grid_neibs_ord1

p

a number for the order of the temporal lag for values at a specific location

slags

a vector with the length of the order of temporal lags for values at immediately neighbouring locations. A value of 0 means no neighbours are used at that temporal lag, a value of 1 means that the values of immediate neighbours are included for that temporal lag.

Value

a data frame with columns time, site, target, as many self_lag columns as p, and as many top, bottom, right and left neighbour value lags as the sum of slags.

See Also

grid_neibs_ord1


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