Learn R Programming

TeachBayes (version 0.1.0)

normal_update: Updates a Normal Prior with Normal Data

Description

Finds the parameters of the normal posterior with normal data and a normal prior

Usage

normal_update(prior, data, teach=FALSE)

Arguments

prior
vector with components mean and sd of the normal prior
data
vector with components the sample mean and the standard error of the estimate
teach
logical variable indicating the form of the output

Value

If teach = TRUE, returns data frame that displays the mean, precision, and standard deviation for the prior, data, and posterior. If teach = FALSE, returns a vector with posterior mean and standard deviation.

Examples

Run this code
  prior <- c(100, 10)
  data <- c(110, 15)
  normal_update(prior, data)

Run the code above in your browser using DataLab