I perform Bayesian inference on a mixture model such that $\mu$ is the mixture weight for a feature in the mixture
$p(x | \mu, \theta) = \mu p_{f}(x|\theta) + (1-\mu)p_{nf}(x|\theta)$
I have prior $p(\theta)$ and an implicit likelihood function $\mathcal{N} (f(\mu, \theta), \epsilon)$ where f is a deterministic simulator.
So basically, $p_{f}(x|\theta) = \mathcal{N} (f_{f}(\mu, \theta), \epsilon)$ and $p_{nf}(x|\theta) = \mathcal{N} (f_{nf}(\mu, \theta), \epsilon)$.
I calculate $T(\mu) =-2* ( \; \log p(x|\mu=0, \theta(\mu=0)) - \log p(x | \mu^*, \theta^*) )$ where x is fixed, by replacing $p(x | \mu, \theta) = p(\mu, \theta|x) / p(\mu, \theta)$. The posterior is amortized, so I can condition it on any simulated observation. I only have one observation $x_{obs}$ and I'm trying to plot its p value over the $\chi^2$ distribution over simulated x's, in order to assess which model fits better to it.
Here,
$\theta(\mu=0) = \arg max_{\theta} p(x | \mu=0, \theta) $ (null hypothesis)
$\mu^{*}, \theta^{*} = \arg max_{\mu,\theta} p(x | \mu, \theta) $
I have access to the posterior distribution $p(\theta|x)$ that I can sample from and compute the density of.
I calculate the LLR statistic for several $x_{obs}$ and several simulated x by sampling from the prior of $\theta$ as $x= f(\mu, \theta)$. https://towardsdatascience.com/the-likelihood-ratio-test-463455b34de9 tells me that I should obtain a chi2 distribution with dof being the difference between the model parameters of the whole model- null hypothesis. However, this is what I obtain for two separate models with dof 6.
I get a chi2 of degrees of freedom 19 and not a chi2 for the second model. I would expect a chi2 of degrees of freedom 6. What am I missing?