Skip to contents

Extracts confidence intervals for density estimates

Usage

# S3 method for class 'bbnp_density'
confint(object, parm = NULL, level = 0.95, ...)

Arguments

object

An object of class bbnp_density

parm

Not used (included for S3 generic compatibility)

level

Confidence level (default: 0.95). Note: this parameter is not used as the confidence level is fixed at object creation time.

...

Additional arguments (unused)

Value

For range estimation: a matrix with columns "lower" and "upper" For point estimation: a named vector with elements "lower" and "upper"

Examples

# \donttest{
X <- rnorm(100)
fit <- biasBound_density(X, h = 0.1)
#> Warning: No feasible xi_n passed Schennach's test in interval [1.0353, 3.2739]. Using theoretical upper bound xi_ub = 3.2739. This may indicate insufficient signal or inappropriate xi bounds.
confint(fit)
#>        lower    upper
#>   [1,]     0 1.145517
#>   [2,]     0 1.145517
#>   [3,]     0 1.148412
#>   [4,]     0 1.164795
#>   [5,]     0 1.174779
#>   [6,]     0 1.183493
#>   [7,]     0 1.193032
#>   [8,]     0 1.205724
#>   [9,]     0 1.223196
#>  [10,]     0 1.245437
#>  [11,]     0 1.270480
#>  [12,]     0 1.294645
#>  [13,]     0 1.313283
#>  [14,]     0 1.322000
#>  [15,]     0 1.318096
#>  [16,]     0 1.301741
#>  [17,]     0 1.276594
#>  [18,]     0 1.249801
#>  [19,]     0 1.231607
#>  [20,]     0 1.233018
#>  [21,]     0 1.258182
#>  [22,]     0 1.301857
#>  [23,]     0 1.355816
#>  [24,]     0 1.412059
#>  [25,]     0 1.463867
#>  [26,]     0 1.506931
#>  [27,]     0 1.540168
#>  [28,]     0 1.565749
#>  [29,]     0 1.588203
#>  [30,]     0 1.612728
#>  [31,]     0 1.643264
#>  [32,]     0 1.680878
#>  [33,]     0 1.723036
#>  [34,]     0 1.764022
#>  [35,]     0 1.796355
#>  [36,]     0 1.812810
#>  [37,]     0 1.808641
#>  [38,]     0 1.783309
#>  [39,]     0 1.741290
#>  [40,]     0 1.691623
#>  [41,]     0 1.646070
#>  [42,]     0 1.616058
#>  [43,]     0 1.609071
#>  [44,]     0 1.625766
#>  [45,]     0 1.659433
#>  [46,]     0 1.698269
#>  [47,]     0 1.729293
#>  [48,]     0 1.742262
#>  [49,]     0 1.732550
#>  [50,]     0 1.702347
#>  [51,]     0 1.659898
#>  [52,]     0 1.617075
#>  [53,]     0 1.585939
#>  [54,]     0 1.575059
#>  [55,]     0 1.586953
#>  [56,]     0 1.617765
#>  [57,]     0 1.659396
#>  [58,]     0 1.702593
#>  [59,]     0 1.739490
#>  [60,]     0 1.764957
#>  [61,]     0 1.776729
#>  [62,]     0 1.774676
#>  [63,]     0 1.759697
#>  [64,]     0 1.732889
#>  [65,]     0 1.695213
#>  [66,]     0 1.647694
#>  [67,]     0 1.591898
#>  [68,]     0 1.530279
#>  [69,]     0 1.466185
#>  [70,]     0 1.403435
#>  [71,]     0 1.345652
#>  [72,]     0 1.295556
#>  [73,]     0 1.254477
#>  [74,]     0 1.222228
#>  [75,]     0 1.197237
#>  [76,]     0 1.176682
#>  [77,]     0 1.153647
#>  [78,]     0 1.145517
#>  [79,]     0 1.145517
#>  [80,]     0 1.145517
#>  [81,]     0 1.145517
#>  [82,]     0 1.145517
#>  [83,]     0 1.175015
#>  [84,]     0 1.203649
#>  [85,]     0 1.231376
#>  [86,]     0 1.257529
#>  [87,]     0 1.279864
#>  [88,]     0 1.295864
#>  [89,]     0 1.303425
#>  [90,]     0 1.301378
#>  [91,]     0 1.289821
#>  [92,]     0 1.270150
#>  [93,]     0 1.244768
#>  [94,]     0 1.216475
#>  [95,]     0 1.187478
#>  [96,]     0 1.154210
#>  [97,]     0 1.145517
#>  [98,]     0 1.145517
#>  [99,]     0 1.145517
#> [100,]     0 1.145517
# }