Functions
HaltonSequences.haltonvalue — Functionhaltonvalue(n, base[, T])Return the nth element of the Halton sequence with prime base base (defaults to 2). If a <:Real type T is given, compute the value in that type.
Examples
julia> haltonvalue(4,3,Rational)
4//9HaltonSequences.Halton — TypeHalton(base=2; <keyword arguments>)
Halton{T<:Real}(base=2; <keyword arguments>)Create a Vector-like object for a Halton sequence. Optionally, use a <:Real type T for the elements.
Arguments
base::Integer: prime number base for the sequencestart=1(keyword): starting/offset indexlength=typemax(UInt32)(keyword): length of the sequence vector
Examples
julia> Halton(3,length=4)
4-element Halton{Float64}:
0.3333333333333333
0.6666666666666666
0.1111111111111111
0.4444444444444444julia> Halton{Rational}(2,length=7)
7-element Halton{Rational}:
1//2
1//4
3//4
1//8
5//8
3//8
7//8julia> sum( Halton()[1:10000] )/10000
0.4998324768066406See also: HaltonPoint, haltonvalue
HaltonSequences.HaltonPoint — TypeHaltonPoint(ndim::Integer; <keyword arguments>)
HaltonPoint(base::Vector{<:Integer}; <keyword arguments>)
HaltonPoint{T<:Real}(base::Vector{<:Integer}; <keyword arguments>)Create a Vector-like object for a sequence of ndim-dimensional vectors constructed from Halton sequences. If given, base should be a vector of primes and then ndim=length(base). If T is given, it is the element type for the vectors.
Keyword arguments
start=1: starting/offset indexlength=typemax(UInt32): length of the sequence vector
Examples
julia> HaltonPoint(4,length=5)
5-element HaltonPoint{Float64}:
[0.5, 0.333333, 0.2, 0.142857]
[0.25, 0.666667, 0.4, 0.285714]
[0.75, 0.111111, 0.6, 0.428571]
[0.125, 0.444444, 0.8, 0.571429]
[0.625, 0.777778, 0.04, 0.714286]julia> h = HaltonPoint([5,11,17]); sum(h[10001:20000])/10000
3-element Array{Float64,1}:
0.49996162048000015
0.5000650725546567
0.49992980926952507See also: Halton, haltonvalue