cred_int: Credible interval for pooled distribution

View source: R/Helper_functions.R

cred_intR Documentation

Credible interval for pooled distribution

Description

Returns the interval based on defined quantiles. The approach used only provides an approximate (although quite accurate) integral.

Usage

cred_int(plt_obj, val = "linear pool", interval = c(0.025, 0.975))

Arguments

plt_obj

A plot object from plot_expert_opinion.

val

The name of the opinion for which the interval will be generated.

interval

A vector of the upper and lower probabilities. Default is the standard 95% interval

Value

Credible interval based on the pooled distribution

Examples

param_expert_example1 <- list()
param_expert_example1[[1]] <- data.frame(dist = c("norm","t"),
    wi = c(0.5,0.5), # Ensure Weights sum to 1
    param1 = c(0.1,0.12),
    param2 = c(0.005,0.005),
    param3 = c(NA,3))
plot_opinion1<- plot_expert_opinion(param_expert_example1[[1]], 
              weights = param_expert_example1[[1]]$wi)
cred_int(plot_opinion1,val = "linear pool", interval = c(0.025, 0.975))



expertsurv documentation built on Oct. 5, 2023, 5:09 p.m.