posteriorThetaMAP: Posterior distribution of model parameters

View source: R/posteriorThetaMAP.R

posteriorThetaMAPR Documentation

Posterior distribution of model parameters

Description

Return the parameters of the posterior distribution of the coefficients of the linear model. Data (Y, D) must be provided; sigma0 and lambda (the prior on sigma0) are assumed to be known.

Usage

posteriorThetaMAP(Y, D, sigma0 = 1, lambda = 1)

Arguments

Y

an N-vector of outcomes

D

an N-vector of treatment assignments

sigma0

prior for the standard deviation of the disturbance term in the linear model

lambda

hyperprior for the standard deviation of the disturbance term in the linear model (sigma0)

Value

return the mean vector and the variance covariance matrix for the posterior distribution of the model parameters; mu_n: the mean vector of the posterior distribution of the vector of linear regression coefficients; Sigma_n : the variance-covariance matrix of the posterior distribution of the vector of linear regression coefficients

Examples

df <- dgenRbinom(num.obs=50, p=0.3, q=0.9, seed=1) # Simulate some data
posteriorThetaMAP(df$Y, df$D, sigma0=1, lambda=1)

johnsontr/entmax documentation built on July 2, 2022, 9:23 p.m.