1

半径r取自截止对数正态分布,该分布具有以下概率密度函数:

pdf=((sqrt(2).*exp(-0.5*((log(r/rch)).^2)))./((sqrt(pi.*(sigma_nd.^2))...
    .*r).*(erf((log(rmax/rch))./sqrt(2.*(sigma_nd.^2)))-erf((log(rmin/rch))./sqrt(2.*(sigma_nd.^2))))));

rch, sigma_nd, rmax, 和rmin都是常数。

我从网上找到了解释,但似乎很难找到它的积分然后在Matlab中取逆。

4

4 回答 4

1

如果您的 PDF 是连续的,那么您可以积分以获得 CDF,然后找到 CDF 的倒数并以随机值对其进行评估。

如果您的 PDF 不连续,则可以使用 cumsum 获得离散 CDF,并将其用作 interp() 中的初始 Y 值,初始 X 值与 PDF 采样的值相同,并要求插值在您的 rand() 数字数组中。

于 2011-12-15T06:34:25.197 回答
1

我查了一下,但我的第一直觉是它看起来像是log(r/rch)一个截断的正态分布,限制为log(rmin/rch)log(rmax/rch)。因此,您可以生成适当的截断正态随机变量,例如y,然后r = rch * exp(y)

您可以通过生成未截断的值并替换超出限制的值来生成截断的正态随机变量。或者,您可以使用 CDF 来执行此操作,如 @PengOne 所述,您可以在wikipedia page上找到它。

我(仍然)不确定您的 pdf 是否完全正确,但这里最重要的是分布。

于 2011-12-15T11:41:19.087 回答
1

it's not clear what's your variable, but i'm assuming it's r.

the simplest way to do this is, as Chris noted, first get the cdf (note that if r starts at 0, pdf(1) is Nan... change it to 0):

cdf = cumtrapz(pdf);
cdf = cdf / cdf(end);

then spawn a uniform distribution (size_dist indicating the number of elements):

y = rand (size_dist,1);

followed by a method to place distribution along the cdf. Any technique will work, but here is the simplest (albeit inelegant)

x = zeros(size_dist,1);
for i = 1:size_dist
    x(i) = find( y(i)<= cdf,1);
end

and finally, returning to the original pdf. Use matlab numerical indexing to reverse course. Note: use r and not pdf:

pdfHist = r(x);
hist (pdfHist,50)
于 2011-12-15T15:00:58.643 回答
0

可能对您的分发来说有点过头了——但您总是可以编写Metropolis 采样器

On the other hand - implementation is straight forward so you'd have your sampler very quick.

于 2011-12-15T12:21:50.543 回答