Jump to content

File:Medcouple-distribution.png

Page contents not supported in other languages.
This is a file from the Wikimedia Commons
From Wikipedia, the free encyclopedia

Original file (1,200 × 900 pixels, file size: 45 KB, MIME type: image/png)

Summary

Description
English: Histogram of 5000 random values taken from a gamma distribution with parameters alpha = 3 and beta = 2, with corresponding histogram of the 6.25 million values of the medcouple kernel. The actual medcouple, the median of the second histogram, is at 0.188994, marked with a yellow line.

This was produced by the following GNU Octave code.

# Set the seed, to make this "random" sampling deterministic
randg("seed", 0);

z = gamrnd (3, 2, 5e3, 1);

# Plot the gamma values
subplot(2,1,1);
hist(z,20, "facecolor", [1, 0.5, 0.5]);
title("gamma distribution with alpha=3 and beta=2", "fontsize", 20);
set(gca, "fontsize", 14)

# Naive medcouple algorithm
n = length(z);
n2 = ceil(n/2);
z = sort(z, "descend");
zmed = median(z);
z -= zmed;
zplus = z(z >= 0);
zminus = z(z <= 0)';
zz = (zplus + zminus)./(zplus - zminus);
zz(isnan(zz)) = 0;
zzsort = sort(zz(:), "descend");
medc_idx = ceil(n2^2/2);
mc = zzsort(medc_idx);

# Plot the medcouple distribution
subplot(2,1,2);
hist(zzsort,20, "facecolor", [0.5, 0.5, 1]);

# Draw the medcouple line on the medcouple distribution
hold on;
plot([mc,mc], [0,5e5], "linewidth", 2.5, "color", [0.95, 0.95, 0]);
title("distribution of h(x_i, x_j) values", "fontsize", 20);
set(gca,"xtick", [-1, -0.5, mc, 0.5, 1], "fontsize", 14);
hold off

print medcouple-distribution.png
Date
Source Own work
Author Jordi Gutiérrez Hermoso
This graph image could be re-created using vector graphics as an SVG file. This has several advantages; see Commons:Media for cleanup for more information. If an SVG form of this image is available, please upload it and afterwards replace this template with {{vector version available|new image name}}.


It is recommended to name the SVG file “Medcouple-distribution.svg”—then the template Vector version available (or Vva) does not need the new image name parameter.

Licensing

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
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.

Captions

Add a one-line explanation of what this file represents

Items portrayed in this file

depicts

some value

5 April 2015

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current00:41, 6 April 2015Thumbnail for version as of 00:41, 6 April 20151,200 × 900 (45 KB)JordiGHUser created page with UploadWizard

The following page uses this file:

Metadata