【源碼】產生拉普拉斯分佈的隨機數

在這裏插入圖片描述
本代碼是一個提供具有拉普拉斯(雙指數)分佈隨機數生成的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.

更多精彩文章請關注公衆號:在這裏插入圖片描述

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