update_sigma.ab_fc <- function(Y, Z, X, beta, sigma.squared, a, b) {
# Hyperparameters
V_sigma.ab <- diag(c(1,1))
n_sigma.ab <- 3
# Find n
n <- dim(Y)[1]
# Create matrix from a and b for use in new parameters
abmat <- matrix(c(
sum(a^2),
sum(a*b),
sum(a*b),
sum(b^2)
), ncol=2)
# New parameters
Snew <- solve(solve(V_sigma.ab) + abmat)
nunew <- n_sigma.ab + n
# Calculate the new value and return
return(solve(amen::rwish(S0=Snew, nu=nunew)))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.