A naïve method for computing the partition function is therefore to evaluate The above would require calculating n determinants, resulting in O(n 4 ) complexity.
as we show below Z(θ) may be obtained in O(n 3 ) time using a single determinant evaluation.