We can use MLE to estimate the coefficient in the logistical model (see my post for the derivation), and the following Julia code can help us fit the model quickly.
the algorithm produces a uniformly ergodic chain (Theorem), and the expected acceptance probability associated with the algorithm is at least 1/M when the chain is stationary, and in that sense, the IMH is more efficient than the Accept-Reject algorithm.
Let's illustrate this algorithm with Ga(α,1). We have introduced how to sample from Gamma distribution via Accept-Reject algorithm in Special Distributions, and it is straightforward to get the Gamma Metropolis-Hastings based on the ratio of f/g,
To sample Ga(2.43,1), and estimate Ef(X2)=2.43+2.432=8.33.
We observe (xi,yi),i=1,…,n according to the model
Choose the data-dependent value that makes Eα=α^, where α^ is the MLE of α, so b^=exp(α^+γ).
The estimates of the parameters are α^=15.0479,β^=−0.232163 and σ^β=0.108137.
If K(τ)=log(Eexp(τX)) is the cumulant generating function, solving the saddlepoint equation K′(τ)=x yields the saddlepoint. For noncentral chi squared random variable X, the moment generating function is
ϕX(t)=(1−2t)p/2exp(2λt/(1−2t)),
where p is the number of degrees of freedom and λ is the noncentrality parameter, and its saddlepoint is