sum_squares: Calculate the error in matching a specified confidence...

View source: R/sum_squares.R

sum_squaresR Documentation

Calculate the error in matching a specified confidence interval with a Gamma distribution prior.

Description

Calculate the error in matching a specified confidence interval with a Gamma distribution prior.

Usage

sum_squares(
  shape,
  lower_CI,
  upper_CI,
  mean,
  confidence_level = 0.95,
  alpha = (1 - confidence_level)/2
)

Arguments

shape

The shape ("gamma") parameter of a Gamma distribution

lower_CI

The lower confidence limit that we are trying to match

upper_CI

The upper confidence limit that we are trying to match

mean

The mean of the Gamma distribution (= shape * scale)

confidence_level

The confidence level of the confidence interval (1 - alpha)

alpha

= 1 - 'confidence_level'

Value

The sum of relative squared errors between the confidence limits and the quantiles of the fitted distribution.


dmorrison01/CSICalc documentation built on Aug. 2, 2022, 4:31 a.m.