Learn R Programming

powerprior (version 1.0.0)

posterior_summary: Compute Posterior Summaries

Description

Provides comprehensive posterior summary statistics.

Usage

posterior_summary(posterior, n_samples = 10000, prob = 0.95)

Value

A list with posterior summaries

Arguments

posterior

Posterior object from posterior_univariate() or posterior_multivariate()

n_samples

Number of samples to draw (default: 10000)

prob

Probability for credible intervals (default: 0.95)

Examples

Run this code
set.seed(123)
historical <- rnorm(50, mean = 10, sd = 2)
current <- rnorm(30, mean = 10.5, sd = 2)

pp <- powerprior_univariate(historical, a0 = 0.5)
posterior <- posterior_univariate(pp, current)
summary <- posterior_summary(posterior)
print(summary)

Run the code above in your browser using DataLab