## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(gpciLindleyApprox)

## ----example-custom-----------------------------------------------------------
set.seed(42)
data_obs <- rnorm(50, mean = 10, sd = 1)

# Fit GPCIs using Lindley approximation and Bootstrap CIs
fit_res <- gpci_lindley(
  data = data_obs,
  pdf = function(x, mean = 0, sd = 1) dnorm(x, mean = mean, sd = sd),
  cdf = function(x, mean = 0, sd = 1) pnorm(x, mean = mean, sd = sd),
  chain_length = 300,
  burn_in = 50,
  thinning = 1,
  USL = 13,
  LSL = 7,
  B = 100
)

# Display Summary Diagnostics Table
summary(fit_res)

## ----example-builtin----------------------------------------------------------
dist_weib <- dist_weibull()

fit_weib <- lindley_gpci(
  data = rweibull(50, shape = 2, scale = 5),
  distribution = dist_weib,
  chain_length = 300,
  burn_in = 50,
  thinning = 1,
  USL = 8,
  LSL = 1,
  B = 100
)

summary(fit_weib)

