View source: R/posteriorPredictiveMAP.R
posteriorPredictiveMAP | R Documentation |
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.
posteriorPredictiveMAP(Y, D, d, sigma0 = 1, lambda = 1)
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 ( |
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
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.