tscsEstimate {TSCS} | R Documentation |
The Second Step of TSCS for 2D Rectangular Grid System - Estimation
Description
tscsEstimate
estimates the missing observations within the cross-section data (pure spatial data)
of a particular time point you have selected, namely, the interpolation process.
Usage
tscsEstimate(matrix, newdata, h, v)
Arguments
matrix |
data frame; the first return value |
newdata |
data frame; should only contain the three variables in order: X coordinate, Y coordinate and observation. This is the cross-section data or pure spatial data of a particular time point you have selected, with missing observations that you want to predict. (coordinates must be numeric) |
h |
numeric; side length of the unit grid in X coordinate direction. |
v |
numeric; side length of the unit grid in Y coordinate direction. |
Details
The first step of TSCS spatial interpolation should be carried out by function
tscsRegression
, which is the prerequisite oftscsEstimate
.For 3D rectangular grid system, the procedure of TSCS stays the same. Please see
tscsRegression3D
andtscsEstimate3D
.Attentions: Since TSCS is only capable of interpolation but not extrapolation, please make sure that the missing observations in a given spatial domain are all located at interior spatial locations. Otherwise, extrapolation would occur with an error following.
Value
A list of 3 is returned, including:
estimate
data frame; estimate of missing observations which contains the 3 variables in order: X coordinate, Y coordinate and estimation.
complete
data frame; an updated version of the cross-section data (pure spatial data)
newdata
, with all of its missing observations interpolated.NA_id
an integer vector; reveals the instance ID, in data frame
newdata
, of spatial locations with missing observation.
See Also
tscsRegression
, tscsEstimate3D
, plot_NA
, plot_map
Examples
## 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)