The stochastic approximation method consists of, given an observed field Z
,
and a starting parameters configuration \(\theta_0\), successively sample
a field \(Z_t\) from the current parameter configuration and estimate the
direction of the gradient of the likelihood function by comparing the
sufficient statistics in the current sample and the observed field.
The solution is updated by moving in the estimated direction with a predefined
step size \(\gamma_t\), a new field \(Z_{t+1}\) is sampled using the new
parameter configuration and \(Z_t\) as an initial value, and the process is
repeated.
$$\theta_{t+1} = \theta_t - \gamma_t(T(Z_t) - T(Z)),$$
where \(T(Z)\) is the sufficient statistics for the reference field,
\(T(Z_t)\) is the sufficient statistics for a field sampled from
\(\theta_t\).
gamma_seq
is normalized internally by diving values by length(Z)
, so the
choice of the sequence is invariant to the lattice dimensions. Typically, a
sequence like seq(from = 1, to = 0, length.out = 1000)
should be used for
defining a sequence with 1000
steps. Some tuning of this sequence is
required.