Return the coefficients in the Halton equation for a list of Halton indices (boxes).
halton.coefficients(samp, J, bases = c(2, 3))
A vector of Halton indices.
A vector of powers of the bases. This determines the level of hierarchy in the Halton boxes and the number of boxes.
The bases of the Halton sequence.
An array of size length(samp)
X max(J)
X length(J)
of coefficients. Row i, column j, page k of this array is the jth coefficient
for the kth dimension of the ith index in samp
.
Let digits = halton.coefficients(samp,J,bases)
,
K = max(J)
and
places <- 1/matrix(rep(bases,each=K)^(1:K),K,length(J))
.
The coordinate in [0,1) of the lower left corner of
the Halton box with index samp[i]
is
colSums(digits[i,,] * places, na.rm = T)
.
This is how you get the Halton sequence from this routine.
However, if you are interested in the Halton sequence alone,
not the coefficients, call function halton()
.