# Which gradient to compute in a hierarchical model for M-H MCMC?

We have the following model: $$y_t=Mx_t+\epsilon_t$$ with $$M$$ being a matrix such that $$M\sim F_{\lambda}$$(assume it's a conjugate prior). The $$\lambda$$ does not appear in $$M$$, only in its distribution.

The problem is that I would like the data to determine $$\lambda$$, not the user. So, I'm thinking of using a Metropolis-Hastings algorithm. In this case, I'm thinking of assuming $$\lambda \sim F$$, and then usually I would use the likelihood and from its gradient get a mean for the proposal, i.e. the new lambda, $$\lambda^*$$, would be drawn from the following proposal density $$q$$:

$$q(\lambda^*\mid \mu^*,\Sigma)$$

where $$\mu^*=\mu+\frac{\partial}{\partial \lambda}p(Y\mid X, \lambda)$$ and $$\Sigma$$ is a scale matrix.

However, since the likelihood doesn't depend on the $$\lambda$$, I was thinking of using $$p(M\mid \lambda)$$ instead and do the gradient, i.e.

$$\mu^*=\mu+\frac{\partial}{\partial \lambda}p(M\mid \lambda)$$

I think in this case I'm making $$\lambda$$ behave as an hyperparameter.

Is my plan acceptable?