wtf1: Monotone Degree-One Weighted Trend Filter

View source: R/wtf1.R

wtf1R Documentation

Monotone Degree-One Weighted Trend Filter

Description

Estimate the mean of a homoscedastic sequence of independent Gaussian observations under squared error loss. The optimal separable estimator is estimated by minimizing an unbiased estimate of the risk under a monotone non-decreasing constraint. Under the monotonicity constraint, the unbiased risk estimate looks like a degree-one weighted trend filter.

Usage

wtf1(
  x,
  s,
  tau = TV1.oracle.plugin(x = x, s = s),
  M = ceiling(sqrt(length(x))),
  knots = NULL,
  backend = "CVXR",
  solver = "OSQP",
  ...
)

wtf1.cvxr(x, s, tau, knots = NULL, solver = "OSQP", ...)

wtf1.mosek(x, s, tau, knots = NULL)

Arguments

x

Gaussian sequence

s

standard deviation

tau

a scalar bound on TV(d')

M

number of evenly spaced knots (overrides knots if both specified)

knots

locations of knots

backend

one of "CVXR" or "MOSEK"

solver

solver backend for CVXR

...

additional parameters passed to CVXR::psolve() (if CVXR backend is used)

Details

The use of the MOSEK backend or solver required a properly installed 'Rmosek' package. The latest installation instructions found here: https://docs.mosek.com/latest/install/index.html and https://docs.mosek.com/latest/rmosek/install-interface.html.

The CVXR and MOSEK backends are designed for internal use only and do not validate inputs.

Value

theta_hat

estimated values of means of Gaussian sequence

x

original Gaussian sequence

s

known standard deviation

SURE

value of minimum risk estimate

tau

the user specified bound on TV(d')

TV1

the value of TV(d') for minimizer

intercept

intercept of fitted estimator

slopes

slopes of fitted estimator

knots

location of knots

backend

which version of wtf1 was used

solver

solver used by CVXR

...

additional inputed parameters

Examples

# basic usage
set.seed(1)
theta = rnorm(250)
x = theta + rnorm(250)
res = wtf1(x, s = 1, tau = 1.2, knots = -2:2)
mean((theta - res$theta_hat)^2)

barbehenna/coleReg documentation built on May 8, 2022, 12:05 a.m.