View source: R/confidenceBands.R
confidenceBands | R Documentation |
Confidence Bands for Wasserstein Regression
confidenceBands( wass_regress_res, Xpred_df, level = 0.95, delta = 0.01, type = "density", figure = TRUE, fig_num = NULL )
wass_regress_res |
an object returned by the |
Xpred_df |
k-by-p matrix (or dataframe, or named vector) used for prediction. Note that Xpred_df should have the same column names with Xfit_df used in wass_regress_res |
level |
confidence level |
delta |
boundary control value in density band computation. Must be a value in the interval (0, 1/2) (default: 0.01) |
type |
'density', 'quantile' or 'both'
|
figure |
logical; if TRUE, return a sampled plot (default: TRUE) |
fig_num |
the fig_num-th row of |
This function computes intrinsic confidence bands for Xpred_df
if type
= 'quantile' and density bands if type
= 'density', and visualizes the confidence and/or density bands when figure
= TRUE.
a list containing the following lists:
den_list: |
|
quan_list: |
|
cdf_list: |
|
alpha = 2 beta = 1 n = 50 x1 = runif(n) t_vec = unique(c(seq(0, 0.05, 0.001), seq(0.05, 0.95, 0.05), seq(0.95, 1, 0.001))) set.seed(1) quan_obs = simulate_quantile_curves(x1, alpha, beta, t_vec) Xfit_df = data.frame(x1 = x1) res = wass_regress(rightside_formula = ~., Xfit_df = Xfit_df, Ytype = 'quantile', Ymat = quan_obs, Sup = t_vec) confidence_Band = confidenceBands(res, Xpred_df = data.frame(x1 = c(-0.5,0.5)), type = 'both', fig_num = 2) data(strokeCTdensity) predictor = strokeCTdensity$predictors dSup = strokeCTdensity$densitySupport densityCurves = strokeCTdensity$densityCurve xpred = predictor[2:3, ] res = wass_regress(rightside_formula = ~., Xfit_df = predictor, Ytype = 'density', Ymat = densityCurves, Sup = dSup) confidence_Band = confidenceBands(res, Xpred_df = xpred, type = 'density', fig_num = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.