BLB.adapt: BLB with adaptive selection on r and s

Description Usage Arguments Value Examples

View source: R/Module1_code.R

Description

BLB function which returns the average (across dimensions) confidence interal width or the average standard error of the parameter and the values of r and s which were chosen adaptively within the function

Usage

1
2
BLB.adapt(data, gamma = 0.7, w_s = 3, w_r = 20, lambda = 10^(-5),
  epsilon = 0.05, alpha = 0.05)

Arguments

data

a matrix or dataframe

gamma

specifies the subsample size by b=n^gamma

w_s

window size for the adaptive selection of s

w_r

window size for the adaptive selection of r

lambda

specifies the L2 penalty in Ridge regression

alpha

the level of the confidence which is set to 0.05

epsilon

relative error for the convergence criterion in adaptive selection

Value

a list consisting of

s

the total number of subsamples from the original dataset

r

the number of resamples for each subsample

final_CI

the final confidence interval for all the components of the parameter estimate

CI_widths

the widths of the final confidence interval for all the components of the parameter estimate

mean_width

mean_width the average marginal width of the confidence intervals across dimensions

final_se

the final standard error for all the componennts of the parameter estimate

mean_se

mean_se the average standard error across the parameter dimensions

Examples

1
2
3
4
5
6
X <- mvrnorm(100, mu = rep(0,2), Sigma <- diag(2))
epsilon <- rnorm(100, mean=0, sd=sqrt(10))
t_theta <- as.matrix(rep(1, 2))
Y <- X %*% t_theta + epsilon
my_data <- cbind(X, Y)
my_result <- BLB.adapt(my_data, gamma=0.7, w_s=3, w_r=20, lambda=10^(-5), epsilon=0.05, alpha=0.05)

EllaKaye/Module1 documentation built on May 6, 2019, 3:25 p.m.