matlab 求取对数正态分布参数

2025-05-10 10:18:16
推荐回答(2个)
回答1:

你输入help
longnrnd后有段显示如下:
r
=
lognrnd(mu,sigma)
returns
an
array
of
random
numbers
generated
from
the
lognormal
distribution
with
parameters
mu
and
sigma.
mu
and
sigma
are
the
mean
and
standard
deviation,
respectively,
of
the
associated
normal
distribution.
mu
and
sigma
can
be
vectors,
matrices,
or
multidimensional
arrays
that
have
the
same
size,
which
is
also
the
size
of
r.
a
scalar
input
for
mu
or
sigma
is
expanded
to
a
constant
array
with
the
same
dimensions
as
the
other
input.
这段文字明确的告诉你了,
r
=
lognrnd
(mu,sigma),返回一个随机产生的对数正态分布

mu和sigma的均值和标准差,mu和sigma可以是
vectors,
matrices,
or
multidimensional
array,他们具有相同的大小,和产生的r是一样的。
我翻译水平有限,你自己翻译看看,体会里面的意思吧.
你说的是方差为2.9,不是标准差,
还有问题的话你自己琢磨,多看看help文件有很大的帮助

回答2:

哦这个比较简单

直接使用lognifit函数就可以了

你给出数据 我直接帮你拟合

比如我给出一个实例
[code]
%生成一个logn分布的随机数
>>data=lognrnd(1,2,1,1000);
%参数拟合
>>[parmhat,parmci] = lognfit(data)

parmhat =

0.9138 1.8870

parmci =

0.7967 1.8078
1.0309 1.9735[/code]

%by dynamic
%see also http://www.matlabsky.com
%contact me matlabsky@gmail.com
%2009.2.
%