> For the complete documentation index, see [llms.txt](https://json007.gitbook.io/svm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://json007.gitbook.io/svm/mathsui_sui_nian/sampling.md).

# sampling

## 随机模拟

统计模拟中有一个重要的问题就是给定一个概率分布$$p(x)$$，我们如何在计算机中生成它的样本。

> 线性同余发生器 $$X\_n =(aX\_{n-1} + b) \bmod m$$ 一般m为2的幂，方便计算机运算。发生器种子就是$$X\_0$$\
> 扩充，二次同余发生器 $$Xn =(aX\_{n-1}^2 + bX\_{n-1}+c) \bmod m$$

[LDA-math-MCMC 和 Gibbs Sampling](http://cos.name/2013/01/lda-math-mcmc-and-gibbs-sampling/\\)

主要点： 马尔科夫过程的平稳状态： $$\lim\_{n\rightarrow\infty}P\_{ij}^n = \pi(j)$$ ，及细致平稳状态： $$\pi(i)P\_{ij} = \pi(j)P\_{ji} \quad\quad \text{for all} \quad i,j$$

![](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F78c173ac7651a40811fa9c4d50ebcb1f28f68206.png?generation=1589383923817565\&alt=media)

![gibbs](https://2270971654-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7DcNFhVrwIk3Tks_pB%2Fsync%2F30c74fb2eb4a0ab044e06da00a06af49305e3beb.png?generation=1589383923989458\&alt=media)

## 参考佳文

[随机采样方法整理与讲解（MCMC、Gibbs Sampling等）](http://www.cnblogs.com/xbinworld/p/4266146.html\)%20%20%0A\[MC,%20MCMC,%20Gibbs采样%20原理&实现（in%20R）]\(http://blog.csdn.net/abcjennifer/article/details/25908495\)%20%20%0A\[LDA-math-认识Beta/Dirichlet分布]\(http://cos.name/2013/01/lda-math-beta-dirichlet/\)%20%20%0A\[徐亦达的机器学习视频]\(http://i.youku.com/u/UMzIzNDgxNTg5Ng==/videos)

[再谈MCMC方法](http://bindog.github.io/blog/2015/10/15/revisit-mcmc-method)
