当前位置:网站首页>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
边栏推荐
猜你喜欢

深度学习知识点杂谈

活体检测PatchNet学习笔记

wangeditor编辑器内容传至后台服务器存储

WeChat applet source code acquisition and decompilation method

活体检测CDCN学习笔记

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

MySQL master-slave switching steps

MW: 3400 4-Arm PEG-DSPE four-arm-polyethylene glycol-phospholipid a saturated 18-carbon phospholipid

DC-CDN学习笔记

VS通过ODBC连接MYSQL(一)
随机推荐
Cholesterol-PEG-Amine CLS-PEG-NH2 胆固醇-聚乙二醇-氨基科研用
MySQL 免安装版的下载与配置教程
cv2.imread()
Podspec verification dependency error problem pod lib lint , need to specify the source
MW: 3400 4-Arm PEG-DSPE four-arm-polyethylene glycol-phospholipid a saturated 18-carbon phospholipid
Fluorescein-PEG-DSPE 磷脂-聚乙二醇-荧光素荧光磷脂PEG衍生物
Pytorch实现ResNet
Word vector - demo
unicloud cloud development record
RuntimeError: CUDA error: no kernel image is available for execution on the device问题记录
Cholesterol-PEG-DBCO 胆固醇-聚乙二醇-二苯基环辛炔化学试剂
VS connects to MYSQL through ODBC (2)
Tensorflow相关list
UiBot has an open Microsoft Edge browser and cannot perform the installation
A simple bash to powershell case
CAS:474922-22-0 Maleimide-PEG-DSPE 磷脂-聚乙二醇-马来酰亚胺简述
wangeditor富文本编辑器上传图片以及跨域问题解决
Navicat从本地文件中导入sql文件
qt:cannot open C:\Users\某某某\AppData\Local\Temp\main.obj.15576.16.jom for write
Fluorescein-PEG-DSPE Phospholipid-Polyethylene Glycol-Fluorescein Fluorescent Phospholipid PEG Derivatives