get_phi_space_wts: Calculate spatially-biased re-sampling weights with phi...

Description Usage Arguments Value

View source: R/sampling_weight.R

Description

Calculate weights for re-sampling with a spatial bias with phi look-up. Observations have a distance that tends to 1 as they are farther away from the closest relevant case (besides itself) at time slice t (meaning they are more likely to be kept). Farthest away from relevant cases at time slice t: d -> 1.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
get_phi_space_wts(
  df,
  phi,
  rel.thr,
  sites_sf = NULL,
  lon = NULL,
  lat = NULL,
  crs = NULL,
  site_id,
  time
)

Arguments

df

a data frame

phi

a vector of the relevance values of df's target variable

rel.thr

a relevance threshold above which an observation is considered relevant

sites_sf

An sf obejct containing station and IDs and geometry points of the locations. As an alternative, provide lon, lat, and crs

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

site_id

the name of the column containing location IDs

time

the column name of the time-stamp

Value

A vector of spatially-biased re-sampling weights, scaled to fit within range [0,1].


mrfoliveira/STResampling-JDSA2020 documentation built on June 28, 2021, 7:01 p.m.