-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathnavego_example_normality_test.m
More file actions
64 lines (40 loc) · 1.2 KB
/
navego_example_normality_test.m
File metadata and controls
64 lines (40 loc) · 1.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Ali Mohammadi_INS/GNSS
% navego_example_normality_test: example of how to use NaveGo functions for
% test normality of a data vector
clc
clear
close all
matlabrc
format SHORTE
addpath ./
addpath ./../
%% TEST A GAUSSIAN DISTRIBUTION
X = randn(10000,1);
[pd, ha] = normality_test (X);
if ~( ha )
disp('navego_normality_test: data under analysis comes from a normal distribution.');
else
disp('navego_normality_test: data under analysis does not come from a normal distribution.');
end
figure
plot_histogram (X, pd)
title ('HISTOGRAM')
figure
r = plot_cdf (X, pd)
title('NORMAL CUMULATIVE DISTRIBUTION')
fprintf('navego_normality_test: RMSE between ideal CDF and real CDF is %f \n', r)
%% TEST A UNIFORM DISTRIBUTION
Y = rand(10000,1);
[pd, ha] = normality_test (Y);
if ~( ha )
disp('navego_normality_test: Data under analysis comes from a normal distribution.');
else
disp('navego_normality_test: data under analysis does not come from a normal distribution.');
end
figure
plot_histogram (Y, pd)
title ('HISTOGRAM')
figure
r = plot_cdf (X, pd)
title('NORMAL CUMULATIVE DISTRIBUTION')
fprintf('navego_normality_test: RMSE between ideal CDF and real CDF is %f \n', r)