使数据符合正态分布 [英] Fit data to normal distribution
问题描述
我希望一些数据适合相应的高斯分布.
I want some data to fit the corresponding Gaussian distribution.
数据本来应该是高斯分布的,但是由于某些过滤的原因,它们不能完全匹配规定的和期望的高斯分布.因此,我的目标是减少数据与所需分布之间的现有分散.
The data is meant to be Gaussian already, but for some filtering reasons, they will not perfectly match the prescribed and expected Gaussian distribution. I therefore aim to reduce the existing scatter between data and desired distribution.
例如,我的数据符合高斯分布,如下所示(预期平均值为0,标准偏差为0.8):
For example, my data fit the Gaussian distribution as follows (the expected mean value is 0 and the standard deviation 0.8):
这种近似值已经很不错了,但是我真的想解决模拟数据和预期分布之间仍然明显的分散.
The approximation is already decent, but I really want to crunch the still tangible scatter between simulated data and expected distribution.
我该如何实现?
编辑
到目前为止,我已经介绍了一种安全系数,定义为:
Up to now, I have introducing kinda safety factor, defined as:
SF = expected_std/actual_std;
然后
new_data = SF*old_data;
通过这种方法,标准偏差与期望值匹配,但是根据我的理解,此过程看起来很差.
This way the standard deviation matches the expected value, but this procedure looks quite poor from my understanding.
推荐答案
如果您不想对分布进行任何非线性转换,则只需调整均值和标准差即可.
If you don't want to make any non-linear transformations of the distributions, all you can do is adjust the mean and standard deviation.
%# 1. adjust the mean (do this even if the offset is small)
data = data - mean(data);
%# 2. adjust the standard deviation
data = data/std(data) * expected_SD;
这篇关于使数据符合正态分布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!