【源码】产生拉普拉斯分布的随机数

在这里插入图片描述
本代码是一个提供具有拉普拉斯(双指数)分布随机数生成的Matlab函数,类似于内置的Matlab函数“rand”和“randn”。

The present code is a Matlab function that provides a generation of random numbers with Laplace (double exponential) distribution, similarly to built-in Matlab functions “rand” and “randn”.

函数输出是一个拉普拉斯分布的矩阵,均值mu=0,标准差sigma=1。

The output of the function is a matrix with Laplacian distributed numbers with mean value mu = 0 and standard deviation sigma = 1.

如果mu和sigma需要指定其它的值,那么可以使用以下形式:mu+sigma*randl(m,n)。

If other values of mu and sigma are a must, then the following form could be used: mu + sigma*randl(m, n).

为了说明函数的用法,给出了一个例子。

An example is given in order to clarify the usage of the function.

参考文献:

The code is based on the theory described in:

[1] S. Kotz, T. Kozubowski, K. Podgorski. The Laplace Distribution and Generalizations. New York, Springer Science & Business Media, 2001.

更多精彩文章请关注公众号:在这里插入图片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章