posteriorPredictiveMAP: Maximum a posteriori estimate of the posterior predictive...

View source: R/posteriorPredictiveMAP.R

posteriorPredictiveMAPR Documentation

Maximum a posteriori estimate of the posterior predictive distribution of the outcome NOTE: I need to verify the assumptions about the prior sigma0 and the hyperior lambda necessary for the Bayesian MLE estimate to coincide with the MAP (i.e., the modal) estimate of the posterior predictive distribution.

Description

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

Usage

posteriorPredictiveMAP(Y, D, d, sigma0 = 1, lambda = 1)

Arguments

Y

an N-vector of outcomes

D

an N-vector of treatment assignments

d

the treatment designation for the new observation

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 and variance of the posterior predictive distribution of the dependent variable Y; mu_n: the mean vector of the posterior distribution of the model parameters; Sigma_n: the variance-covariance matrix of the posterior distribution of the model parameters

Examples

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

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