taper_single: Compute Taper at a Specified Argument

View source: R/tapered_estimator.R

taper_singleR Documentation

Compute Taper at a Specified Argument

Description

This helper function computes the taper function for a given window function as

a(x; \rho) = \left\{ \begin{array}{ll} w(2x/\rho) & 0 \leq x < \frac{1}{2} \rho, \\ 1 & \frac{1}{2}\rho \leq x \leq \frac{1}{2} \\ a(1 - x; \rho) & \frac{1}{2} < x \leq 1 \end{array} , \right.

where w(\cdot) is a continuous increasing function with w(0)=0, w(1)=1, \rho \in (0, 1], and x \in [0, 1]. The possible window function choices are found in window.

Usage

taper_single(x, rho, window_name, window_params = c(1), custom_window = FALSE)

Arguments

x

A number between 0 and 1 (inclusive).

rho

A scale parameter in (0, 1].

window_name

The name of the window function to be used. Possible values are: tukey, triangular, power_sine, blackman, hann_poisson, welch. Alternatively, a custom window function can be provided, see the example.

window_params

A vector of parameters of the window function.

custom_window

If a custom window is to be used or not. Defaults to FALSE.

Value

A value of the taper function at x.

Examples

x <- 0.4
taper_single(x, 0.5, "tukey")
my_taper <- function(x, ...) {
  return(x)
}
taper_single(x, 0.5, my_taper, custom_window = TRUE)

CovEsts documentation built on Sept. 10, 2025, 10:39 a.m.