Normality test temperature data

2 ビュー (過去 30 日間)
Sarah Yun
Sarah Yun 2019 年 12 月 14 日
編集済み: dpb 2019 年 12 月 15 日
Hi,
I have a column of temp data - some neagative values.
I applied a KS and lillietest to the data - it is NOT normally distributed.
As data has negative values, I can't apply a log transform.
Even if I apply log transform, the data takes on non-real values e.g. 5.21493575760899 + 3.14159265358979i
Any ideas how I can transform the data to make it normally distributed?
Nothing too complicated - I am a beginner.
Thank you.
  1 件のコメント
dpb
dpb 2019 年 12 月 15 日
編集済み: dpb 2019 年 12 月 15 日
"Any ideas how I can transform the data to make it normally distributed?"
W/O any idea of what the data looks like, no.
But, there may be no need...what is end objective?
However, if you feel compelled the Box-Cox transformation is one common technique that is pretty general. See <NIST handbook EDA Box-Cox Transformation>

サインインしてコメントする。

回答 (1 件)

Ridwan Alam
Ridwan Alam 2019 年 12 月 15 日
編集済み: Ridwan Alam 2019 年 12 月 15 日
Since linear shift won't affect the distribution, you can shift the data and perform log transformation.
%% test data
data = randn(1000,1);
data = data - min(data) + 1;
% making sure that the data is not normal
data = exp(data);
% also, since your data has many negative values
data = data - 0.9*max(data);
lillietest(data) % ans = 1
% LOG TRANSFORMATION
% first, shift your data to all positive range
posdata = data - min(data) + 1;
lillietest(posdata) % ans = 1
% then, perform log transformation
logdata = log(posdata);
lillietest(logdata) % ans = 0
Hope this helps!

カテゴリ

Help Center および File ExchangeTime Series についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by