matlab 求取对数正态分布参数

毕设需要,恳求数学学院的那位高手给写一段程序,万分感激!

想做一个简单的拟合,条件:给定一组数据x,y,它们服从对数正态分布,或者说,在区间
[0,12]服从对数正态分布,现在想用对数正态分布的函数将其拟合出来,就是要估计出对
数正态分布的分布函数中的那两个参数。然后再画出拟合图!

实在搞不定这软件了,谢谢,谢谢!

你输入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文件有很大的帮助
温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2016-10-18
哦这个比较简单

直接使用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 [email protected]
%2009.2.
%本回答被提问者采纳
相似回答