title: How do I implement maximum likelihood estimation type 2?
body: <p>I am trying to implement an empirical bayesian ML-II（Maximum likelihood estimation Type II）method for estimating prior distribution parameters from historical data</p>
  
  <p>Where：</p>
  
  <ol>
  <li>π(θ) is an expression for the prior distribution</li>
  <li>p(x|θ) is is an expression for the data distribution</li>
  <li>m(x) is an expression for the marginal distribution</li>
  </ol>
  
  <p>According to the steps, I need to first integrate to find the expression of the marginal distribution, and then find the extreme value of this expression to estimate the parameters of the prior distribution.
  Extreme values can be achieved using methods such as <code>scipy.optimize</code>. So the question is how do we integrate this?</p>
  
  <p><img src="https://i.stack.imgur.com/9s3sC.jpg" alt="enter image description here"></p>