get_st_neighbours: Get spatio-temporal neighbourhood

Description Usage Arguments Details Value References

View source: R/st_indicators.R

Description

A function that calculates the observations that are within a spatio-temporal neighbourhood of a certain radius of a time and location.

Usage

1
2
get_st_neighbours(site, time, radius, t_dist_mat, s_dist_mat, alpha,
  time_id = "time", site_id = "site_id")

Arguments

site

a location ID

time

a time-stamp

radius

a radius of spatio-temporal distance

t_dist_mat

a matrix of normalized temporal distances between time-stamps (rownames and colnames should be a concatenation of "TIME_" and the time-stamp)

s_dist_mat

a matrix of normalized spatial distances between locations (rownames and colnames should be a concatenation of "SITE_" and the location IDs)

alpha

a weighting factor for the spatio-temporal distance

time_id

the name to give to the column of time-stamps (Default: time)

site_id

the name to give to the column of location IDs (Default: site_id)

Details

The spatio-temporal distance is defined as

D_{i,j} = d_{i,j} x α + t_{i,j} x (1-α)

where d_i,j is the spatial distance between locations, t_i,j is the temporal distance between time-stapms and α is a weighting factor.

Note that radius should always be a number between zero and min(alpha, alpha-1). Also note that if alpha is set to 1, then instead of a cone, the neighbourhood will have the shape of a cylinder.

Value

A data frame where each row describes a neighbour, with the first two columns containing the location ID and time-stamp of the central observation, followed by two columns with the neighbouring location ID and time-stamp, and a final colunm containing the spatio-temporal distance between the two.

References

Ohashi, Orlando, and Luis Torgo. "Wind speed forecasting using spatio-temporal indicators." ECAI. 2012.


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