当前位置:网站首页>Rejection sampling note
Rejection sampling note
2022-07-31 06:17:00 【Young_win】
section 1
The most critical part of reject sampling,make a rectangle、cast points into rectangles, etc.,All that is done is to obtain a uniform distribution of the area enclosed by the density curve.As long as it is possible to obtain such a sample that satisfies a uniform distribution under the density curve,We can then obtain a sampling of random variables that match this density curve.方法是,Just extract the abscissa of each blue dot,The sample formed by these abscissas is our target sample.

step1:Wrap this density curve with a rectangle,put density curve framed in a rectangle.
step2:Randomly cast points into the rectangle10000次(虚值).Random casting means within the rectangle,These points are uniformly distributed.
step3:Some points fall on the lower side of the density curve,Some points fall on the upper side of the density curve.Keep only the points on the underside of the density curve.
step4:Extract the abscissa of each blue point,The sample formed by these abscissas is our target sample.
section2
The above uses a rectangle,The rectangle is a proposed distribution that satisfies the uniform distribution,The proposed distribution is just an aid to obtain uniformly distributed samples under the curve of the target density function.Using a uniform distribution as the suggested distribution is sometimes inefficient,为什么这么说?It can be seen from the above example that,Evenly distributed many points(those green dots)都被剔除了,Caused a waste.Some other curves can be selected to frame the density curve,效率会提高一点.
这里The target density function curve is h ( x ) h(x) h(x),Corresponds to the blue line in the figure below;Suggestions for distribution density curves g ( x ) g(x) g(x),我们把 g ( x ) g(x) g(x)Multiply by a constant factor c c c,然后 用 c g ( x ) cg(x) cg(x)这条曲线 Frame the target density curve.
假定满足 g ( x ) g(x) g(x)Random variables of easily sampled,The steps to reject sampling are as follows:
- 从 g ( x ) g(x) g(x)Take a sample data,记 x ⋆ x^{\star} x⋆,take it as a suggestion
- Do you want to accept this suggestion? 作为满足 h ( x ) h(x) h(x)What about a sample data from the distribution??我们定义一个接受概率: α = h ( x ⋆ ) c g ( x ⋆ ) \displaystyle\alpha = \frac{h(x^{\star})}{c g(x^{\star})} α=cg(x⋆)h(x⋆)
也就是说,我们以 α \alpha α的概率 接受 x ⋆ x^{\star} x⋆ 作为 h ( x ) h(x) h(x)A sample of data distributed.
实际操作中,取一个 U ( 0 , 1 ) U(0, 1) U(0,1)的随机数 μ \mu μ,如果 μ < α \mu<\alpha μ<α,就接受 x ⋆ x^{\star} x⋆作为 h ( x ) h(x) h(x)a sample data of;否则,throw it away,回到1.步继续循环.Finally a sample can be obtained.
- The beginning of the article is to extract all at once10000个点,How did it become one by one??In fact, they correspond,The process of removing the blue dot Is equivalent to do whether refused to determine process.
- If there are uniformly distributed samples under the density curve,to get a sample of the distribution that matches the density curve.
- If the shape of the proposed distribution is closer to the target distribution,The more efficient the sampling is.
参考文献:https://gaolei786.github.io/statistics/reject.html
边栏推荐
- Phospholipids-Polyethylene Glycol-Active Esters for Scientific Research DSPE-PEG-NHS CAS: 1445723-73-8
- 词向量——demo
- Cholesterol-PEG-Acid CLS-PEG-COOH Cholesterol-Polyethylene Glycol-Carboxyl Modified Peptides
- VTK环境配置
- Embedding前沿了解
- MySQL 入门:Case 语句很好用
- Fluorescein-PEG-DSPE 磷脂-聚乙二醇-荧光素荧光磷脂PEG衍生物
- Tensorflow——演示
- DSPE-PEG-Biotin,CAS:385437-57-0,磷脂-聚乙二醇-生物素可延长循环半衰期
- TransactionTemplate 事务编程式写法
猜你喜欢

CAS:1403744-37-5 DSPE-PEG-FA 科研实验用磷脂-聚乙二醇-叶酸

random.randint函数用法

Sourcery插件(自动提升代码质量)

mysql 事务原理详解

使用 OpenCV 提取图像的 HOG、SURF 及 LBP 特征 (含代码)

This in js points to the prototype object

Embedding cutting-edge understanding

2022 SQL big factory high-frequency practical interview questions (detailed analysis)

DSPE-PEG-Azide DSPE-PED-N3 磷脂-聚乙二醇-叠氮脂质PFG

qt:cannot open C:\Users\XX\AppData\Local\Temp\main.obj.15576.16.jom for write
随机推荐
Fluorescein-PEG-DSPE 磷脂-聚乙二醇-荧光素荧光磷脂PEG衍生物
科学研究用磷脂-聚乙二醇-活性酯 DSPE-PEG-NHS CAS:1445723-73-8
MySQL master-slave switching steps
np.fliplr与np.flipud
Jupyter内核正忙、内核挂掉
Attention based ASR(LAS)
random.randint函数用法
多元线性回归方程原理及其推导
VTK环境配置
数据预处理、特征工程和特征学习-摘抄
IDEA控制台不能输入信息的解决方法
计算图像数据集均值和方差
2022 SQL big factory high-frequency practical interview questions (detailed analysis)
This in js points to the prototype object
ROS 之订阅多个topic时间同步问题
MySQL 主从切换步骤
Xiaomi mobile phone SMS location service activation failed
cocos2d-x-3.2 image graying effect
Cholesterol-PEG-Azide CLS-PEG-N3 胆固醇-聚乙二醇-叠氮 MW:3400
用pytorch里的children方法自定义网络