I am trying to understand what is the right way to pick up an "action", as it is called in Murphy, Machine Learning a Probabilistic Perspective, in the 'chatper 'Bayesian decision theory'.
I'll make the question more clear as in the previous post it wasn't. Suppose our data comes froma a linear process $Y = \beta X + \epsilon$. Theoretically, given a set of training data $D = (\mathbb{Y}, \mathbb{X})$ one would like to minimize the generalization error $E_{Y|X,\theta^*, D}[\mathcal{L}(Y, g(X, D))|D]$ where $\mathcal{L}$ is a loss function, $g$ is a prediction model we trained on $D$, that is, once given a new input it outputs a decision $\hat{Y}$, and the expectation is taken with respect to the true, unknown, data generating process, that is simply $Y = \beta X + \epsilon$ for unknown $\beta$ for the present example. The only way we have to estimate the generalization error is to use a separated test set, but if we use it to select a prediction model this of course no longer is a test set. So in frequentist theory, given that the objective is the generalization error one search for strategy to evaluate it, its mean over the training sets, some other proxy of it or uses some theoretical selection creiteria all based on the idea that you training is one out of the possibles under the true DGP.
Now, what is not clear to me is how you should reason in bayesian framework, what is your objective. So, for what I understand, even in bayesian framework to assess the generalization capacity of my model I need a test set. If I did it with respect to my posterior I would end up be fine with something that is actually not fine I suppose. So, even in a bayesian framework my ideal objective would be the generalization error previously defined, where the average is taken with respect to the true DGP. So, even in bayesian framework we can't directly minimize it, as we can't use the test data to pick up a model.
So, question 1, is it correct that what we do, in being bayesian, is to try to approximate this generlization error by taking its mean over the posterior predictive?
So, instead of:
$ err(g) = E_{Y|X,\theta^*}[\mathcal{L}(Y, g(X, D))] =\int \mathcal{L}(y, g(X, D))p(Y|X, \theta^*)\mathrm{d}y = \int \mathcal{L}(y, \beta_{\lambda}(D)X) p(Y|X, \theta^*)\mathrm{d}y $
that is the generalization error of interest, where in the last equality I explicitely write the forecast relative to a given estimate of the parametrs under a ridge penalty at a specific value $\lambda$, we evaluate:
$ \int \mathcal{L}(y, g(X, D))p(y|X, g)p(g|D)\mathrm{d}y\mathrm{d}g = \int \mathcal{L}(y, \beta_{\lambda}X)p(y|X, \beta)p(\beta|\lambda, D) p(\lambda |D)\mathrm{d}y\mathrm{d}\beta\mathrm{d}\lambda $
And then another point of confusion. Assume that we have a ridge model prior and be $\lambda$ the hyperparameter of such a prior. And assume we are using a quadratic loss, using absolute value does not cheange my point.
How do I build my forecast on a new unseen data X?
Option 1: Be
$ p(Y|X, D) = \int p(Y|X, \beta)p(\beta|D, \lambda) p(\lambda | D) \mathrm{d}\beta\mathrm{d}\lambda $
my posterior predictive. If your minimization problem is:
$ a^*(X) = \mathrm{argmin}_{a: \mathcal{D}_X \to \mathcal{D}_Y}\int\mathcal{L}(y, a(X))P(y|X, D) \mathrm{d}y $
then your forecast $a(X)$, for a quadratic loss, would be the mean of the posterior.
Option 2:
$ a^*(X) = \mathrm{argmin}_{a}\int\mathcal{L}(y, a(X, \beta, \lambda))p(Y|X, \beta)p(\beta|D, \lambda) p(\lambda | D) \mathrm{d}\theta\mathrm{d}\lambda \mathrm{d}y $
In this second case, it is not clear to me how should I pick up a but for re-evaluating the integral at each new point.