I want to fit a model to a dataset by using an optimization procedure (i.e. scipy's least_square). My original MLE/least-squares objective function is:
$$ \underset{\theta}{\text{argmin}}\left( \frac{1}{2} \sum_n[f(x_n|\theta) - y_n]^2 \right)$$
As a next step, I want to incorporate a prior distribution on the $\theta$ parameters, which are two and I've decided to model as a bivariate normal distribution.
$$ P(\theta) \sim N(\mu_{\theta}, \Sigma_{\theta}) $$
Note that $\theta$ and $\mu_{\theta}$ are a $1\times2$ vector, while $\Sigma_{\theta}$ is a $2 \times 2$ covariance matrix (i.e. the 2 parameters have non-zero correlation).
I have already good estimates for $\mu_{\theta}$ and $\Sigma_{\theta}$, and I want to include this prior distribution as an additional regularization term in the objective function. In probability space, what I want to do is find the maximum a posteriori (MAP) estimate:
$$ \underset{\theta}{\text{argmax}}\left( P(\theta) P(X|\theta)\right)$$
My question is: what is the correct formulation for the least squares objective function that incorporates the prior distribution as a regularization term?
I tried to work the math, and the closest I could get is the first formula below (1). I also found on the internet formula (2).
$$ \begin{align} & 1) \space\space \underset{\theta}{\text{argmin}}\left( \frac{1}{2} \sum_n[f(x_n|\theta) - y_n]^2 + \frac{1}{2} (\theta - \mu_{\theta})^T \Sigma_{\theta}^{-1} (\theta - \mu_{\theta})\right) \\ & 2) \space\space \underset{\theta}{\text{argmin}}\left( \frac{1}{2} \sum_n[f(x_n|\theta) - y_n]^2 + \frac{\text{det} (\Sigma_{\theta})^{0.5}}{2} (\theta - \mu_{\theta})^T(\theta - \mu_{\theta}) \right) \end{align}$$
Is either of these correct? Any advice on how to correctly define this MAP objective function is appreciated.
Thanks!