Skip to contents

Creates visualizations of bias-bounded density estimation results

Usage

# S3 method for class 'bbnp_density'
plot(
  x,
  type = c("density", "ft"),
  fill_ci = "green",
  fill_bias = "orange",
  alpha_ci = 0.5,
  alpha_bias = 0.5,
  ft_resol = 500,
  ...
)

Arguments

x

An object of class bbnp_density

type

Character string specifying plot type. Options are:

  • "density" (default): Density estimate with bias bounds and confidence intervals

  • "ft": Fourier transform plot with estimated envelope

fill_ci

Color for confidence interval ribbon (default: "green")

fill_bias

Color for bias bound ribbon (default: "orange")

alpha_ci

Transparency for confidence interval ribbon (default: 0.5)

alpha_bias

Transparency for bias bound ribbon (default: 0.5)

ft_resol

Resolution for Fourier transform plot (default: 500)

...

Additional arguments (unused)

Value

A ggplot2 object

Examples

# \donttest{
X <- rnorm(100)
fit <- biasBound_density(X, h = 0.1)
#> Warning: No feasible xi_n passed Schennach's test in interval [1.0598, 3.3513]. Using theoretical upper bound xi_ub = 3.3513. This may indicate insufficient signal or inappropriate xi bounds.
plot(fit)

plot(fit, type = "ft")

# }