sd0 <- 20 phi0 <- sd0^2 theta0 <- 370 sdobs <- 8 phi <- sdobs^2 x <- 421 phi1 <- (phi0^(-1) + phi^(-1))^(-1) sd1 <- sqrt(phi1) theta1 <- phi1*(theta0/phi0 + x/phi) sd0hat <- 50 phi0hat <- sd0hat^2 theta0hat <- 400 phi1hat <- (phi0hat^(-1) + phi^(-1))^(-1) sd1hat <- sqrt(phi1hat) theta1hat <- phi1*(theta0hat/phi0 + x/phi) cat("First scientist has posterior mean",theta1,"and s.d.",sd1,".\n") cat("Second scientist has posterior mean",theta1hat,"and s.d.",sd1hat,".\n")