# Using probability rules how is the following equation is true

I have found the below equation from this paper and trying to see how it is true.

$$$$p\left(\hat{\boldsymbol{y}}_{i} | \mathbf{x}_{i}, \mathcal{D}\right)=\int_{\theta} p\left(\hat{\boldsymbol{y}}_{i} | \mathbf{x}_{i}, \mathcal{D}, \boldsymbol{\theta}\right) p(\boldsymbol{\theta} | \mathcal{D}) d \boldsymbol{\theta}$$$$

$$$$\hat{\boldsymbol{y}}_{i} = output, D = dataset, \theta = parameters, \mathbf{x}_{i} = inputs$$$$

I tried the following to prove:

Using the sum rule $$$$p\left(\hat{\boldsymbol{y}}_{i} | \mathbf{x}_{i}, \mathcal{D}\right)= \int_{\theta} p\left(\hat{\boldsymbol{y}}_{i},\boldsymbol{\theta}\right | \mathbf{x}_{i}, \mathcal{D}) d\theta$$$$

Using the product rule

$$$$p\left(\hat{\boldsymbol{y}}_{i} | \mathbf{x}_{i}, \mathcal{D}\right)=\int_{\theta} p\left(\hat{\boldsymbol{y}}_{i} | \theta ,\mathbf{x}_{i}, \mathcal{D}\right) p(\boldsymbol{\theta} | \mathbf{x}_{i}, \mathcal{D}) d \boldsymbol{\theta}$$$$

assuming $$\theta$$ is independent of $$\mathbf{x}_{i}$$ we can rewrite it as:

$$$$p\left(\hat{\boldsymbol{y}}_{i} | \mathbf{x}_{i}, \mathcal{D}\right)=\int_{\theta} p\left(\hat{\boldsymbol{y}}_{i} | \theta ,\mathbf{x}_{i}, \mathcal{D}\right) p(\boldsymbol{\theta} | \mathcal{D}) d \boldsymbol{\theta}$$$$

Does the above derivation right? If so, how can the parameters to the Neural network be independent of the inputs? Is it safe to assume?