umr_deconv: Carpentier and Schluter 2016 deconvolution method for...

Description Usage Arguments Details Examples

View source: R/umr_deconv.R

Description

Carpentier and Schluter 2016 deconvolution method for unmatched monotone regression

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
umr_deconv(xx, yy, sig, error = "normal", bw = "dboot1", adjust = 1, n = 512)

quant_deconv(
  yy,
  sig,
  error = "normal",
  bw = "dboot1",
  adjust = 1,
  n = 512,
  monotonize = base::cummax
)

Arguments

xx

X (covariate or predictor) observation vector

yy

Y (response) observation vector (numeric)

sig

standard deviation of epsilon (passed to DeconCdf)

error

Must be "normal" or "laplacian" or "snormal"; see help("DeconCdf")

bw

Bandwidth choice or method for kernel estimator; see help("DeconCdf")

adjust

See help("DeconCdf")

n

See help("DeconCdf")

monotonize

is a function taking a numeric vector argument which returns an increasing numeric vector of the same length. This is used to monotonize the output of the CDF from deconvolution, which is not guaranteed to be a "bona-fide" CDF in the sense that it may not be monotone.

Details

quant_deconv implements Carpentier and Schluter 2016 deconvolution method for unmatched monotone regression, using deconv package. Note that because the DeconCdf() function computes the CDF but there is no direct code for computing the quantile function, we use approxfun to create the quantile function; this may be slow. quant_deconv() returns a vector of length length(yy). Then umr_deconv is a wrapper for quant_deconv. NOTE: It returns the output of approxfun, which is may change over time. The output value is of type function. We linearly interpolate between the points i/n.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
library(distr)
mysig <- 1 ##  std dev
errdist <- distr::Norm(0, sd=mysig)
mm0 <- function(xx){xx}
 nn <- 300
 xx <- sort(runif(n=nn, 0, 7))
 yy <- mm0(xx) + errdist@r(nn)
 ## plot(xx,yy)
 modeldistname <- truedistname <- "Gauss" ## used for savefile name
myScale <- mysig

xx <- sort(runif(n=nn, 0, 7))
mmtrue <- mm0(xx)
yy <- mmtrue + errdist@r(nn)
plot(xx,yy)
qq <- quant_deconv(yy, sig=1, error="normal")
lines(xx, ## already sorted
     qq)

UMR documentation built on Aug. 14, 2021, 9:09 a.m.

Related to umr_deconv in UMR...