操作数据以更好地拟合高斯分布 [英] manipulate data to better fit a Gaussian Distribution

查看:22
本文介绍了操作数据以更好地拟合高斯分布的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于正态分布的问题(mu = 0sigma = 1).

I have got a question concerning normal distribution (with mu = 0 and sigma = 1).

假设我首先以这种方式调用 randn 或 normrnd

Let say that I firstly call randn or normrnd this way

x = normrnd(0,1,[4096,1]); % x = randn(4096,1)

现在,为了评估 x 值与正态分布的拟合程度,我调用

Now, to assess how good x values fit the normal distribution, I call

[a,b] = normfit(x);

并有图形支持

histfit(x)

现在来到问题的核心:如果我对 x 如何拟合给定的正态分布不够满意,我如何优化 x更好地拟合预期的正态分布分布0 均值1 标准差??有时因为很少的表示值(即 4096 在这种情况下),x 与预期的高斯拟合非常差,所以我想操纵 x(线性与否,在这个阶段并不重要)以获得更好的适应度.

Now come to the core of the question: if I am not satisfied enough on how x fits the given normal distribution, how can I optimize x in order to better fit the expected normal distribution with 0 mean and 1 standard deviation?? Sometimes because of the few representation values (i.e. 4096 in this case), x fits really poorly the expected Gaussian, so that I wanna manipulate x (linearly or not, it does not really matter at this stage) in order to get a better fitness.

我想说的是,我可以访问统计工具箱.

I'd like remarking that I have access to the statistical toolbox.

编辑

  1. 我用 normrndrandn 做了这个例子,因为我的数据应该并且预期具有正态分布.但是,在问题中,这些功能只会有助于更好地理解我的担忧.

  1. I made the example with normrnd and randn cause my data are supposed and expected to have normal distribution. But, within the question, those functions are only helpful to better understand my concern.

是否可以应用最小二乘拟合?

一般我得到的分布类似于以下:

Generally the distribution I get is similar to the following:

我的

推荐答案

也许,您可以尝试将输入数据标准化为 mean=0 和 sigma=1.像这样:

Maybe, you can try to normalize your input data to have mean=0 and sigma=1. Like this:

y=(x-mean(x))/std(x);

这篇关于操作数据以更好地拟合高斯分布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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