Description Usage Arguments Details Value See Also Examples
View source: R/namespace.R View source: R/tscsRegression3D.R
To implement TSCS spatial interpolation for a spatial domain that is a 3D rectangular grid system,
the first step is obtaining regression coefficient matrix, which can be done
by function tscsRegression3D
. 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.
1 | tscsRegression3D(data, h1, h2, v, alpha = 0.05)
|
data |
data frame; should contain these variables in order: X coordinate, Y coordinate, Z coordinate and
observations as time goes on. That is to say, each row should include X, Y and Z 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 |
h1 |
numeric; side length of the unit cubic grid in X coordinate direction (horizontal). |
h2 |
numeric; side length of the unit cubic grid in Y coordinate direction (horizontal). |
v |
numeric; side length of the unit cubic grid in Z coordinate direction (vertical). |
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) |
The second step of TSCS spatial interpolation should be carried out by function tscsEstimate3D
,
where you have to input the cross-section data or pure spatial data of a particular time point
you have selected, with missing observations that you want to predict.
For 2D rectangular grid system, the procedure of TSCS stays the same.
Please see tscsRegression
and tscsEstimate
.
Attentions:
(1) Since TSCS is only capable of interpolation but not extrapolation, it is necessary to highlight the
difference between interior spatial locations and system boundary. Function plot3D_dif
can help.
(2) NA value in historical spatio-temporal data data
is not allowed. Please handle them beforehand
(such as filling these NA values through spatio-temporal kriging).
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
.
tscsEstimate3D
, tscsRegression
, plot3D_dif
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 <- tscsRegression3D(data = data, h1 = 3.75, h2 = 2.5, v = 5, alpha = 0.01);
basis$percentage
est <- tscsEstimate3D(matrix = basis$coef_matrix, newdata = newdata, h1 = 3.75, h2 = 2.5, v = 5);
str(est)
## comparison of estimates and true values:
plot_compare(est = est$estimate[,4], true = true)
index <- appraisal_index(est = est$estimate[,4], true = true);
index
## data visualization:
plot3D_dif(data = data[,1:3], h1 = 3.75, h2 = 2.5, v = 5)
plot3D_NA(newdata = newdata)
plot3D_map(newdata = newdata)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.