Halton Sequence

Halton序列是一种用于生成数值方法中空间点的确定性低偏差序列,适用于多种模拟场景,如蒙特卡罗模拟。该文介绍了Halton序列的构造原理,并通过一个简单的二维示例进行说明。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In statisticsHalton sequences are sequences used to generate points in space for numerical methods such asMonte Carlo simulations. Although these sequences are deterministic they are of low discrepancy, that is, appear to be random for many purposes. They were first introduced in 1960 and are an example of a quasi-random numbersequence. They generalise the one-dimensional van der Corput sequences.

Example of Halton sequence used to generate points in (0, 1) × (0, 1) in R2[edit]

The Halton sequence is constructed according to a deterministic method that uses a prime number as its base. As a simple example, let's take one dimension of the Halton sequence to be based on 2 and the other on 3. To generate the sequence for 2, we start by dividing the interval (0,1) in half, then in fourths, eighths, etc., which generates

12143418583878116916,...

and to generate the sequence for 3, we divide the interval (0,1) in thirds, then ninths, twenty-sevenths, etc., which generates

1323194979295989127,...

When we pair them up, we get a sequence of points in a unit square:

( 1213), ( 1423), ( 3419), ( 1849), ( 5879), ( 3829), ( 7859), ( 11689), ( 916127).

Even though standard Halton sequences perform very well in low dimensions, correlation problems have been noted between sequences generated from higher primes. For example if we started with the primes 17 and 19, the first 16 pairs of points would have perfect linear correlation. To avoid this, it is common to drop the first 20 entries, or some other predetermined number depending on the primes chosen. In order to deal with this problem, various other methods have been proposed; one of the most prominent solutions is the scrambled Halton sequence, which uses permutations of the coefficients used in the construction of the standard sequence.

Implementation in Pseudo Code[edit]

   FUNCTION (index, base)
   BEGIN
       result = 0;
       f = 1 / base;
       i = index;
       WHILE (i > 0) 
       BEGIN
           result = result + f * (i % base);
           i = FLOOR(i / base);
           f = f / base;
       END
       RETURN result;
   END
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值