merliseclyde / BAS

BAS R package for Bayesian Model Averaging and Variable Selection
https://merliseclyde.github.io/BAS/
GNU General Public License v3.0
41 stars 16 forks source link

[Enhancement] Specific flat priors for the always include variables #22

Open AlexanderLyNL opened 6 years ago

AlexanderLyNL commented 6 years ago

Hi Merlise,

Do you think it's sensible to have a flat priors on the always include variables as we discussed in Edinburgh? I think that this makes sense and I believe that this boils down to a simple numerical integral with a change of degrees of freedom. I'll look into the formulas a bit more, once I'm done with some other work.

Cheers, Alexander

merliseclyde commented 6 years ago

It is an extension of the idea of the flat prior on the intercept that it always included. In theory, the covariance of the g-prior would be defined as $XM^T(I - P{X.inc})X_M$ where $P_X.inc$ is the orthogonal projection on the column space of $X.inc$ (the always included variables) and $X_M$ are the variables that are under consideration for model $M$.

All the formulas for the log of the marginal likelihood would go through with changing df from $n-1$ to $n - p_inc$ and with an adjustment to define the "R2" to have the SS from the model with $X_inc$ (rather than the intercept) in the denominator, which would be easy to add.

The trickier part would be the bookkeeping with the post-processing functions that compute predictions and posterior distributions for coefficients as now only some will be shrunk.