在MATLAB中从Weibull分布生成样本 [英] Generating samples from Weibull distribution in MATLAB

查看:542
本文介绍了在MATLAB中从Weibull分布生成样本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用命令wblrnd(12.34,1.56)来获取带有这些参数的Weibull分布内的100个不同值.

I am using the command wblrnd(12.34,1.56) to get 100 different values that lie within the Weibull distribution with those parameters.

但是我希望那100个点/值与参数给定的点/值具有相同的分布.不会发生.

But I want those 100 points/values to have the same distribution as the one given by the parameters. Which doesn't happen.

我基本上想要得到100个值,这些值给我与以前完全相同的分布.

Basically I want, to get 100 values that give me the exact same distribution I had before.

推荐答案

除非您执行的抽奖次数为无限,否则您的分布不能与采样的分布相同.

You cannot have the same distribution as the one you're sampling from, unless the number of draws you perform is infinite.

要给您一个实际的例子,您可以比较绘图的经验分布(即直方图)与拟合的pdf的匹配方式:

To give you a practical example you can compare how the empirical distribution of your draws, i.e. the histogram, matches the fitted pdf:

subplot(121)
sample = wblrnd(12.34,1.56,100,1);    
histfit(sample,100,'wbl')
title('100 draws')

subplot(122)
sample = wblrnd(12.34,1.56,1e5,1);    
histfit(sample,100,'wbl')
title('100,000 draws')

此外,请注意,均值和标准差不是wblrnd(A,B)的参数.换句话说,mean(sample)不应收敛到12.34.

Also, note that the mean and standard deviations are NOT the arguments of wblrnd(A,B). In other words, mean(sample) is not supposed to converge to 12.34.

您可以查看维基百科:Weibull分布如何从形状和标度参数,即理论值由12.34和1.56给出.

You can check on wikipedia: weibull distribution how to retrieve the mean from the shape and scale parameters, i.e. what theoretical mean is given by 12.34 and 1.56.

这篇关于在MATLAB中从Weibull分布生成样本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆