当前位置:网站首页>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
边栏推荐
- Flow control statement in js
- Pytorch学习笔记13——Basic_RNN
- 机器学习和深度学习概述
- 使用 OpenCV 提取图像的 HOG、SURF 及 LBP 特征 (含代码)
- Cholesterol-PEG-Azide CLS-PEG-N3 胆固醇-聚乙二醇-叠氮 MW:3400
- Cholesterol-PEG-DBCO Cholesterol-Polyethylene Glycol-Diphenylcyclooctyne Chemical Reagent
- Fluorescein-PEG-DSPE 磷脂-聚乙二醇-荧光素荧光磷脂PEG衍生物
- MYSQL transaction and lock problem handling
- MySQL 免安装版的下载与配置教程
- Hyperparameter Optimization - Excerpt
猜你喜欢

JS写一段代码,判断一个字符串中出现次数最多的字符串,并统计出现的次数JS

2021-09-30

After unicloud is released, the applet prompts that the connection to the local debugging service failed. Please check whether the client and the host are under the same local area network.

jenkins +miniprogram-ci upload WeChat applet with one click

Cholesterol-PEG-NHS NHS-PEG-CLS 胆固醇-聚乙二醇-活性酯可修饰小分子材料

softmax函数详解

Fluorescein-PEG-DSPE Phospholipid-Polyethylene Glycol-Fluorescein Fluorescent Phospholipid PEG Derivatives

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

random.randint函数用法

活体检测CDCN学习笔记
随机推荐
DSPE-PEG-Biotin,CAS:385437-57-0,磷脂-聚乙二醇-生物素可延长循环半衰期
ROS之service传输图片
化学试剂磷脂-聚乙二醇-氨基,DSPE-PEG-amine,CAS:474922-26-4
Tensorflow——demo
SSH automatic reconnection script
wangeditor编辑器内容传至后台服务器存储
VS通过ODBC连接MYSQL(二)
YOLOX中的SimOTA
break and continue exit in js
学习JDBC之获取数据库连接的方式
DSPE-PEG-COOH CAS: 1403744-37-5 Phospholipid-polyethylene glycol-carboxy lipid PEG conjugate
多元线性回归方程原理及其推导
Cholesterol-PEG-Amine CLS-PEG-NH2 Cholesterol-Polyethylene Glycol-Amino Research Use
ROS 之订阅多个topic时间同步问题
RuntimeError: CUDA error: no kernel image is available for execution on the device问题记录
mPEG-DMPE Methoxy-polyethylene glycol-bismyristyl phosphatidylethanolamine for stealth liposome formation
虚拟机查看端口号进程
MYSQL transaction and lock problem handling
Cholesterol-PEG-Acid CLS-PEG-COOH Cholesterol-Polyethylene Glycol-Carboxyl Modified Peptides
UiBot has an open Microsoft Edge browser and cannot perform the installation