Description Usage Arguments Details Value See Also
View source: R/sampling_weight.R
A function that calculates different weights for re-sampling that is temporally and/or spatially biased.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
form |
a formula describing the learning task |
df |
a data frame |
phi.control |
list of parameters as returned
by function |
site_id |
the name of the column containing location IDs |
time |
the column name of the time-stamp |
rel.thr |
a relevance threshold above which an observation is considered relevant |
ptype |
type of spatio-temporal bias to calculate |
alpha |
weighting parameter for temporal and spatial re-sampling probabilities. Default 0.5 |
sites_sf |
An sf obejct containing station and IDs and
geometry points of the locations. As an alternative, provide
|
lon |
the name of the column containing the location's longitude |
lat |
the name of the column containing the location's latitude |
crs |
the code for the Coordinate Reference System |
phi
gives the target variable's relevance
(higher relevance: phi -> 1; lower relevance: phi -> 0);
time_wts
gives the observation's temporally biased
re-sampling weight (most recent observations: w -> 1;
oldest: w -> 0.); space_wts
gives the observation's
spatially biased re-sampling weight (farthest away from other
relevant cases at time slice: d -> 1.).
High time_wts
or space_wts
means the observation is
more likely to be kept.
a data.frame with relevance phi
,
temporally biased weights time_wts
,
and spatially biased weights space_wts
for
each row in df
.
get_phi
, get_time_wts
,
get_phi_space_wts
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.