R/mlnormal_linear_regression_bayes.R

Defines functions mlnormal_linear_regression_bayes

## File Name: mlnormal_linear_regression_bayes.R
## File Version: 0.04


mlnormal_linear_regression_bayes <- function( W, beta, W2, mu2 )
{
    # given OLS estimate beta with precison W and
    # prior distribution N(mu2, W2^-1)
    Wtot1 <- solve( W + W2 )
    beta <- Wtot1 %*% ( W %*% beta + W2 %*% mu2 )
    return(beta)
}

Try the LAM package in your browser

Any scripts or data that you put into this service are public.

LAM documentation built on May 18, 2022, 5:17 p.m.