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