get_phi_time_wts: Calculate temporally-biased re-sampling weights with phi...

Description Usage Arguments Value Author(s)

View source: R/sampling_weight.R

Description

Calculate weights for re-sampling with a temporal bias. As time goes by past an extreme value, the weight tends to 1. While no extreme value appears, the weight stays at 0 (meaning they are less likely to be kept). More distant to previous rare value: w -> 1; very close to recent rare value / no rare values so far: w -> 0.

Usage

1
get_phi_time_wts(df, phi, rel.thr, time, site_id)

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

time

the column name of the time-stamp

site_id

the name of the column containing location IDs

Value

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

Author(s)

Mariana Oliveira


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