tscsRegression: The First Step of TSCS for 2D Rectangular Grid System -...

Description Usage Arguments Details Value See Also Examples

View source: R/namespace.R View source: R/tscsRegression.R

Description

To implement TSCS spatial interpolation for a spatial domain that is a 2D rectangular grid system, the first step is obtaining regression coefficient matrix, which can be done by function tscsRegression. It is the prerequisite of TSCS interpolation process because the 'matrix' derived from historical spatio-temporal data is the initial value of the second step - estimating missing observations.

Usage

1
tscsRegression(data, h, v, alpha = 0.05)

Arguments

data

data frame; should contain these variables in order: X coordinate, Y coordinate and observations as time goes on. That is to say, each row should include X and Y coordinate first, and then a time series. This is the historical spatio-temporal data that you intend to analyze as the basis for interpolation later on in tscsEstimate.

h

numeric; side length of the unit grid in X coordinate direction.

v

numeric; side length of the unit grid in Y coordinate direction.

alpha

numeric; specify the significance level for ADF test, to test if the time series of a group of spatial locations are cointegrated. (default: 0.05)

Details

Value

A list of 2 is returned, including:

coef_matrix

data frame; regression coefficient matrix to be used as input parameter of function tscsEstimate in the second step of TSCS interpolation.

percentage

numeric; percentage of cointegrated relationships, a measurement of the degree it satisfies the assumption of cointegrated system. It is highly affected by parameter alpha, the significance level you have set. Explicitly, smaller alpha results in smaller percentage.

See Also

tscsEstimate, tscsRegression3D, plot_dif

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 

## TSCS spatial interpolation procedure:

basis <- tscsRegression(data = data, h = 1, v = 1, alpha = 0.01); # regression
basis$percentage # see the percentage of cointegrated relationships
est <- tscsEstimate(matrix = basis$coef_matrix, newdata = newdata, h = 1, v = 1); # estimation
str(est)

## comparison of estimates and true values:

plot_compare(est = est$estimate[,3], true = true) # graphic comparison
index <- appraisal_index(est = est$estimate[,3], true = true); # RMSE & std
index

## data visualization:

plot_dif(data = data[,1:2], h = 1, v = 1) # differentiate boundary and interior spatial locations
plot_NA(newdata = newdata) # show spatial locations with missing value, for a cross-section data
plot_map(newdata = newdata) # plot the 2D spatial map, for a cross-section data

## End(Not run)

TSCS documentation built on May 2, 2019, 4:04 p.m.

Related to tscsRegression in TSCS...