File:KuiperTestVisualization 2Sample.png
From Wikimedia Commons, the free media repository
Jump to navigation
Jump to search
KuiperTestVisualization_2Sample.png (560 × 420 pixels, file size: 23 KB, MIME type: image/png)
File information
Structured data
Captions
Captions
Add a one-line explanation of what this file represents
Summary
[edit]DescriptionKuiperTestVisualization 2Sample.png |
English: Visualization of Kuiper Test Statistic with two sample traces. Modified source code from user Bscan's work on 2 sampled KS-test. Matlab code shown below |
Date | |
Source | Own work |
Author | Lucas(CA) |
%Matlab code for two-sample Kuiper-Test visualization
%Generate random samples on [0,2pi)
% modified from user Bscan's work on 2 sampled KS-test
num_samps =100;
mean1 = pi; std1 = pi/2;
mean2 = pi/4; std2 = pi/2;
randn
dat1 = mod(mean1 + std1*randn(num_samps,1),2*pi);
dat2 = mod(mean2 + std2*randn(num_samps,1), 2*pi);
%Get emprical cdfs
[f1,x1] = ecdf(dat1);
[f2,x2] = ecdf(dat2);
for k1 = 1:length(x1);
[~,k2] = min(abs(x2 - x1(k1))); % closest x2 value to x1
cdf_diff(k1) = f1(k1) - f2(k2);
end
[D_plus,ind_plus] = max(cdf_diff);
[D_minus,ind_minus] = max(-cdf_diff);
V = D_plus + D_minus;
%Plot the two ecdfs
figure; hold on;
stairs(x1,f1,'b-','LineWidth',2);
stairs(x2,f2,'r-','LineWidth',2);
set(gca,'FontSize',16) %Increase font size
plot([x1(ind_plus) x1(ind_plus)], [f1(ind_plus), f1(ind_plus)-cdf_diff(ind_plus)],'k')
plot([x1(ind_minus) x1(ind_minus)], [f1(ind_minus), f1(ind_minus)-cdf_diff(ind_minus)],'k')
grid on; box on; %Add grid to figure
xlim([0 2*pi]); ylim([0 1])
xlabel('X (Radians)')
ylabel('Cumulative Probability')
text(x1(ind_plus)+0.05,f1(ind_plus)-0.4*cdf_diff(ind_plus),'D_+','FontSize',18);
text(x1(ind_minus)+0.1,f1(ind_minus)-0.4*cdf_diff(ind_minus),'D_-','FontSize',18);
annotation('textbox', [0.15 0.75 0.2 0.1], 'String', 'V = D_++ D_-','FontSize',18, 'FitBoxToText','on','FaceAlpha',1)
Licensing
[edit]I, the copyright holder of this work, hereby publish it under the following license:
![w:en:Creative Commons](https://upload.wikimedia.org/wikipedia/commons/thumb/7/79/CC_some_rights_reserved.svg/90px-CC_some_rights_reserved.svg.png)
![attribution](https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Cc-by_new_white.svg/24px-Cc-by_new_white.svg.png)
![share alike](https://upload.wikimedia.org/wikipedia/commons/thumb/d/df/Cc-sa_white.svg/24px-Cc-sa_white.svg.png)
This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license.
- You are free:
- to share – to copy, distribute and transmit the work
- to remix – to adapt the work
- Under the following conditions:
- attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- share alike – If you remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.
File history
Click on a date/time to view the file as it appeared at that time.
Date/Time | Thumbnail | Dimensions | User | Comment | |
---|---|---|---|---|---|
current | 22:34, 21 September 2016 | ![]() | 560 × 420 (23 KB) | Lucas(CA) (talk | contribs) | User created page with UploadWizard |
You cannot overwrite this file.
File usage on Commons
There are no pages that use this file.
File usage on other wikis
The following other wikis use this file:
- Usage on en.wikipedia.org
- Usage on uk.wikipedia.org
Metadata
This file contains additional information such as Exif metadata which may have been added by the digital camera, scanner, or software program used to create or digitize it. If the file has been modified from its original state, some details such as the timestamp may not fully reflect those of the original file. The timestamp is only as accurate as the clock in the camera, and it may be completely wrong.
Horizontal resolution | 28.35 dpc |
---|---|
Vertical resolution | 28.35 dpc |
File change date and time | 22:31, 21 September 2016 |
Software used | |
Date and time of digitizing |
|
Hidden categories: