matlab求对数正态的均值和标准差,matlab–从变量的均值,系数生成对数正态分布随机数...

更新时间:2023-05-11 11:57:09 阅读: 评论:0

matlab求对数正态的均值和标准差,matlab–从变量的均值,系数
⽣成对数正态分布随机数...
结果并不令⼈惊讶.对于具有⼤峰度的分布,样本⽅差的预期⽅差⼤致为mu4 / N,其中mu4是分布的第4个时刻.对于对数正态,mu4指数地取决于参数sigma ^ 2,这意味着对于⾜够⼤的sigma值,样本⽅差将相对于真实⽅差在整个地⽅.这正是你所观察到的.在你的例⼦中,mu4 / N~ (coeffOfVar ^ 8)/ N~50 ^ 8 / 1e6~4e7.
exp.var.of.samp.var
(n-1)*((n-1)*mu4-(n-3)*mu2^2)/n^3
}
mu2.lnorm
(exp(sigma^2)-1)*exp(2*mu+sigma^2)
}
mu4.lnorm
mu2.lnorm(mu,sigma)^2*(exp(4*sigma^2)+2*exp(3*sigma^2)+3*exp(2*sigma^2)-3)
}
exp.var.lnorm.var
exp.var.of.samp.var(n,mu2.lnorm(mu,sigma),mu4.lnorm(mu,sigma))
}
var
exp.var.of.samp.var(n,sigma^2,3*sigma^4)
}
coeffOfVar
mean
sigma
mu
n
m
## Get variance of sample variance for lognormal distribution:
cat("samp. variance (mean of",m,"trials):",ial),"\n")
cat("theor. variance:",mu2.lnorm(mu,sigma),"\n")
cat("variance of the sample var:",ial),"\n")
cat("expected variance of the sample var:",exp.var.lnorm.var(n,mu,sigma),"\n")
> samp. variance (mean of 10000 trials): 105.7192
> theor. variance: 100
> variance of the sample var: 350997.7
> expected variance of the sample var: 494053.2
## Do this with normal distribution:
cat("samp. variance (mean of",m,"trials):",ial),"\n")
cat("theor. variance:",sigma^2,"\n")
cat("variance of the sample var:",ial),"\n")
cat("expected variance of the sample var:",var(n,mu,sigma),"\n") > samp. variance (mean of 10000 trials): 3.257944
> theor. variance: 3.258097
> variance of the sample var: 0.002166131
> expected variance of the sample var: 0.002122826

本文发布于:2023-05-11 11:57:09,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/78/584935.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:对数   正态   均值
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图