threshold_estimate_locLinear: Threshold estimate based on local linear approximation

Description Usage Arguments Details Value Author(s) References Examples

Description

The main idea for the procedure in Tang et al. (2011) is to utilize a local linear approximation in the vicinity of the first stage estimate, and to bootstrap this local approximation to obtain confidence intervals.

Usage

1
threshold_estimate_locLinear(explanatory, response, Y_0)

Arguments

explanatory

Explanatory sample points

response

Observed responses at the explanatory sample points

Y_0

Threshold of interest

Details

This is an internal function not meant to be called directly. It function uses a local linear approximation to form a point estimate.

Value

threshold_estimate_explanatory

Point estimate of d_0

threshold

Threshold of interest (equal to Y_0 input)

Author(s)

Shawn Mankad

References

Tang R, Banerjee M, Michailidis G (2011). 'A two-stage hybrid procedure for estimating an inverse regression function.' The Annals of Statistics, 39, 956-989.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
X=runif(25, 0,1)
Y=X^2+rnorm(n=length(X), sd=0.1)
oneStage_IR=stageOneAnalysis(X, Y, 0.25, type="IR-wald", 0.99)
X2 = c(rep(oneStage_IR$L1,37),rep(oneStage_IR$U1,38))
Y2=X2^2+rnorm(n=length(X2), sd=0.1)
stageTwoAnalysis(oneStage_IR, explanatory = X2, response = Y2,
type = "locLinear", level = 0.95)


## The function is currently defined as
function (explanatory, response, Y_0) 
{
    n = length(response)
    if (sum(response < Y_0) == n) {
        list(threshold_estimate_explanatory = max(explanatory), 
            threshold_estimate_response = max(response), threshold = Y_0, 
            Y_hat = max(response), index = n)
    }
    else if (sum(response >= Y_0) == n) {
        list(threshold_estimate_explanatory = min(explanatory), 
            threshold_estimate_response = min(response), threshold = Y_0, 
            Y_hat = min(response), index = 1)
    }
    else {
        beta = lm(response ~ explanatory)$coef
        estim_x = (Y_0 - beta[1])/beta[2]
        list(threshold_estimate_explanatory = estim_x, threshold = Y_0)
    }
  }

twostageTE documentation built on May 1, 2019, 9:18 p.m.