added articles

stat challenge day 7
pearson coeff
spearman rank coeff
This commit is contained in:
redoules 2018-11-14 22:50:17 +01:00
parent 95eab816e7
commit fa1731477a
68 changed files with 932 additions and 65 deletions

View File

@ -185,7 +185,7 @@ Mean : 43117.75, Median : 44627.5, Mode : 4978
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -219,7 +219,7 @@ Q1 : 6.0, Q2 : 12, Q3 : 16.0
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -429,7 +429,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@ we call B the event "a blue ball is drawn" and R the event "a red ball is drawn"
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -311,7 +311,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -331,7 +331,7 @@ Between 20 and 22 hours?</p>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -270,7 +270,7 @@ B = 515.68
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -0,0 +1,321 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>Day 7 - Pearson and spearman correlations - Blog</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Basics" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
Day 7 - Pearson and spearman correlations
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2018-11-13T21:18:00+01:00">
13 novembre 2018
</time>
</li>
<li>Blog</li>
<li>Basics</li>
</ol>
</header>
<div class='article_content'>
<h2>Pearson correlation coefficient</h2>
<h3>Problem</h3>
<p>Given two n-element data sets, <span class="math">\(X\)</span> and <span class="math">\(Y\)</span>, calculate the value of the Pearson correlation coefficient.</p>
<h3>Python implementation</h3>
<p>Using the formula</p>
<div class="math">$$\rho_{X,Y}=\frac{cov(X,Y)}{\sigma_X\sigma_Y}$$</div>
<p>where
</p>
<div class="math">$$cov(X,Y)=\frac{1}{n}\sum_{i=1}^{n}(x_i-\bar{x})\cdot(y_i-\bar{y})$$</div>
<div class="highlight"><pre><span></span><span class="n">n</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">X</span> <span class="o">=</span> <span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mf">9.8</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mf">7.8</span><span class="p">,</span> <span class="mf">7.7</span><span class="p">,</span> <span class="mi">7</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
<span class="n">Y</span> <span class="o">=</span> <span class="p">[</span><span class="mi">200</span><span class="p">,</span> <span class="mi">44</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">4</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">cov</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
<span class="n">x_mean</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="n">y_mean</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">Y</span><span class="p">)</span>
<span class="k">return</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">([(</span><span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="n">x_mean</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">Y</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="n">y_mean</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">)])</span>
<span class="k">def</span> <span class="nf">stdv</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">mu_x</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
<span class="k">return</span> <span class="p">(</span><span class="nb">sum</span><span class="p">([(</span><span class="n">x</span> <span class="o">-</span> <span class="n">mu_x</span><span class="p">)</span><span class="o">**</span><span class="mi">2</span> <span class="k">for</span> <span class="n">x</span> <span class="ow">in</span> <span class="n">X</span><span class="p">])</span> <span class="o">/</span> <span class="n">n</span><span class="p">)</span><span class="o">**</span><span class="mf">0.5</span>
<span class="k">def</span> <span class="nf">spearman_1</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
<span class="n">std_x</span> <span class="o">=</span> <span class="n">stdv</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">n</span><span class="p">)</span>
<span class="n">std_y</span> <span class="o">=</span> <span class="n">stdv</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">Y</span><span class="p">),</span> <span class="n">n</span><span class="p">)</span>
<span class="k">return</span> <span class="n">cov</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="n">std_x</span><span class="o">*</span><span class="n">std_y</span><span class="p">)</span>
<span class="n">spearman_1</span><span class="p">(</span><span class="n">X</span><span class="p">,</span><span class="n">Y</span><span class="p">,</span><span class="n">n</span><span class="p">)</span>
</pre></div>
<div class="highlight"><pre><span></span>0.6124721937208479
</pre></div>
<h3>Python implementation</h3>
<p>Using the formula</p>
<div class="math">$$\rho_{X,Y}=\frac{\sum_{i}(x_i-\bar{x})(y_i-\bar{y})}{n\sigma_X\sigma_Y}$$</div>
<div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">spearman_2</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span><span class="n">n</span><span class="p">):</span>
<span class="n">std_x</span> <span class="o">=</span> <span class="n">stdv</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">n</span><span class="p">)</span>
<span class="n">std_y</span> <span class="o">=</span> <span class="n">stdv</span><span class="p">(</span><span class="n">Y</span><span class="p">,</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">Y</span><span class="p">),</span> <span class="n">n</span><span class="p">)</span>
<span class="n">x_mean</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">X</span><span class="p">)</span>
<span class="n">y_mean</span> <span class="o">=</span> <span class="mi">1</span><span class="o">/</span><span class="n">n</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">Y</span><span class="p">)</span>
<span class="k">return</span> <span class="nb">sum</span><span class="p">([(</span><span class="n">X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="n">x_mean</span><span class="p">)</span><span class="o">*</span><span class="p">(</span><span class="n">Y</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="n">y_mean</span><span class="p">)</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">)])</span><span class="o">/</span><span class="p">(</span><span class="n">n</span><span class="o">*</span><span class="n">std_x</span><span class="o">*</span><span class="n">std_y</span><span class="p">)</span>
<span class="n">spearman_2</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span><span class="n">n</span><span class="p">)</span>
</pre></div>
<div class="highlight"><pre><span></span>0.6124721937208479
</pre></div>
<h2>Spearman's rank correlation coefficient</h2>
<h3>Problem</h3>
<p>Given two <span class="math">\(n\)</span>-element data sets, <span class="math">\(X\)</span> and <span class="math">\(Y\)</span>, calculate the value of Spearman's rank correlation coefficient.</p>
<h3>Python implementation</h3>
<p>We knwo that in this case, the values in each dataset are unique. Hence we can use the formula :
</p>
<div class="math">$$r_s=1-\frac{6\sum d_i^2}{n(n^2-1)}$$</div>
<div class="highlight"><pre><span></span><span class="n">n</span> <span class="o">=</span> <span class="mi">10</span>
<span class="n">X</span> <span class="o">=</span> <span class="p">[</span><span class="mi">10</span><span class="p">,</span> <span class="mf">9.8</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mf">7.8</span><span class="p">,</span> <span class="mf">7.7</span><span class="p">,</span> <span class="mf">1.7</span><span class="p">,</span> <span class="mi">6</span><span class="p">,</span> <span class="mi">5</span><span class="p">,</span> <span class="mf">1.4</span><span class="p">,</span> <span class="mi">2</span><span class="p">]</span>
<span class="n">Y</span> <span class="o">=</span> <span class="p">[</span><span class="mi">200</span><span class="p">,</span> <span class="mi">44</span><span class="p">,</span> <span class="mi">32</span><span class="p">,</span> <span class="mi">24</span><span class="p">,</span> <span class="mi">22</span><span class="p">,</span> <span class="mi">17</span><span class="p">,</span> <span class="mi">15</span><span class="p">,</span> <span class="mi">12</span><span class="p">,</span> <span class="mi">8</span><span class="p">,</span> <span class="mi">4</span><span class="p">]</span>
<span class="k">def</span> <span class="nf">spearman_rank</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">n</span><span class="p">):</span>
<span class="n">rank_X</span> <span class="o">=</span> <span class="p">[</span><span class="nb">sorted</span><span class="p">(</span><span class="n">X</span><span class="p">)</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">v</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">X</span><span class="p">]</span>
<span class="n">rank_Y</span> <span class="o">=</span> <span class="p">[</span><span class="nb">sorted</span><span class="p">(</span><span class="n">Y</span><span class="p">)</span><span class="o">.</span><span class="n">index</span><span class="p">(</span><span class="n">v</span><span class="p">)</span><span class="o">+</span><span class="mi">1</span> <span class="k">for</span> <span class="n">v</span> <span class="ow">in</span> <span class="n">Y</span><span class="p">]</span>
<span class="n">d</span> <span class="o">=</span> <span class="p">[(</span><span class="n">rank_X</span><span class="p">[</span><span class="n">i</span><span class="p">]</span><span class="o">-</span><span class="n">rank_Y</span><span class="p">[</span><span class="n">i</span><span class="p">])</span><span class="o">**</span><span class="mi">2</span> <span class="k">for</span> <span class="n">i</span> <span class="ow">in</span> <span class="nb">range</span><span class="p">(</span><span class="n">n</span><span class="p">)]</span>
<span class="k">return</span> <span class="mi">1</span><span class="o">-</span><span class="p">(</span><span class="mi">6</span><span class="o">*</span><span class="nb">sum</span><span class="p">(</span><span class="n">d</span><span class="p">))</span><span class="o">/</span><span class="p">(</span><span class="n">n</span><span class="o">*</span><span class="p">(</span><span class="n">n</span><span class="o">*</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="n">spearman_rank</span><span class="p">(</span><span class="n">X</span><span class="p">,</span> <span class="n">Y</span><span class="p">,</span> <span class="n">n</span><span class="p">)</span>
</pre></div>
<div class="highlight"><pre><span></span>0.9030303030303031
</pre></div>
<script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
var align = "center",
indent = "0em",
linebreak = "false";
if (false) {
align = (screen.width < 768) ? "left" : align;
indent = (screen.width < 768) ? "0em" : indent;
linebreak = (screen.width < 768) ? 'true' : linebreak;
}
var mathjaxscript = document.createElement('script');
mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
mathjaxscript.type = 'text/javascript';
mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML';
mathjaxscript[(window.opera ? "innerHTML" : "text")] =
"MathJax.Hub.Config({" +
" config: ['MMLorHTML.js']," +
" TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," +
" jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
" extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
" displayAlign: '"+ align +"'," +
" displayIndent: '"+ indent +"'," +
" showMathMenu: true," +
" messageStyle: 'normal'," +
" tex2jax: { " +
" inlineMath: [ ['\\\\(','\\\\)'] ], " +
" displayMath: [ ['$$','$$'] ]," +
" processEscapes: true," +
" preview: 'TeX'," +
" }, " +
" 'HTML-CSS': { " +
" styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," +
" linebreaks: { automatic: "+ linebreak +", width: '90% container' }," +
" }, " +
"}); " +
"if ('default' !== 'default') {" +
"MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"}";
(document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}</script>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

View File

@ -286,7 +286,7 @@ maxuploadtarget=5000
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -161,7 +161,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -121,6 +121,7 @@
<div class="panel-body"> <div class="panel-body">
<ul> <ul>
<li><a href="./blog/Statistics_10days-day6.html">11/18 Day 6 - The Central Limit Theorem</a></li> <li><a href="./blog/Statistics_10days-day6.html">11/18 Day 6 - The Central Limit Theorem</a></li>
<li><a href="./blog/Statistics_10days-day7.html">11/18 Day 7 - Pearson and spearman correlations</a></li>
<li><a href="./blog/Statistics_10days-day5.html">11/18 Day 5 - Poisson and Normal distributions</a></li> <li><a href="./blog/Statistics_10days-day5.html">11/18 Day 5 - Poisson and Normal distributions</a></li>
<li><a href="./blog/Statistics_10days-day4.html">11/18 Day 4 - Binomial and geometric distributions</a></li> <li><a href="./blog/Statistics_10days-day4.html">11/18 Day 4 - Binomial and geometric distributions</a></li>
<li><a href="./blog/Statistics_10days-day3.html">11/18 Day 3 - Conditionnal probability</a></li> <li><a href="./blog/Statistics_10days-day3.html">11/18 Day 3 - Conditionnal probability</a></li>
@ -632,6 +633,8 @@
</div> </div>
<div class="panel-body"> <div class="panel-body">
<ul> <ul>
<li><a href="./mathematics/spearman.html">Spearman's Rank Correlation Coefficient</a></li>
<li><a href="./mathematics/pearson.html">Pearson correlation coefficient</a></li>
<li><a href="./mathematics/normal.html">Normal Distribution</a></li> <li><a href="./mathematics/normal.html">Normal Distribution</a></li>
<li><a href="./mathematics/poisson.html">Poisson Distribution</a></li> <li><a href="./mathematics/poisson.html">Poisson Distribution</a></li>
<li><a href="./mathematics/Geometric.html">Geometric distribution</a></li> <li><a href="./mathematics/Geometric.html">Geometric distribution</a></li>
@ -708,7 +711,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -149,7 +149,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -211,7 +211,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -144,7 +144,7 @@ However, you can use the following command to do it </p>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -143,7 +143,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -203,7 +203,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -148,7 +148,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -167,7 +167,7 @@ none 0 0 0 - /config
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@ wifi0 Link encap:UNSPEC HWaddr 5C-51-4F-41-7A-AD-00-00-00-00-00-00-00-00-00
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -172,7 +172,7 @@ USER;PID;%CPU;%MEM;VSZ;RSS;TTY;STAT;START;TIME;COMMAND</p>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -158,7 +158,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -151,7 +151,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -208,7 +208,7 @@ The secret number is 126
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -160,7 +160,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -1033,7 +1033,7 @@ Top dislike features:
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -196,7 +196,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -256,7 +256,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -233,7 +233,7 @@ So :
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -195,7 +195,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -203,7 +203,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -197,7 +197,7 @@ and B are considered to be independent if event A has no effect on the probabili
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -221,7 +221,7 @@ where <span class="math">\(erf\)</span> is the error function:
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

255
mathematics/pearson.html Normal file
View File

@ -0,0 +1,255 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>Pearson correlation coefficient - Mathematics</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Statistics" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
Pearson correlation coefficient
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2018-11-14T21:21:00+01:00">
14 novembre 2018
</time>
</li>
<li>Mathematics</li>
<li>Statistics</li>
</ol>
</header>
<div class='article_content'>
<h2>Covariance</h2>
<p>This is a measure of how two random variables change together, or the strength of their correlation.</p>
<p>Consider two random variables, <span class="math">\(X\)</span> and <span class="math">\(Y\)</span>, each with <span class="math">\(n\)</span> values (i.e., <span class="math">\(x_1\)</span>, <span class="math">\(x_2\)</span>, <span class="math">\(...\)</span>, <span class="math">\(x_n\)</span> and <span class="math">\(y_1\)</span>, <span class="math">\(y_2\)</span>, <span class="math">\(...\)</span>, <span class="math">\(y_n\)</span>). The covariance of <span class="math">\(X\)</span> and <span class="math">\(Y\)</span> can be found using either of the following equivalent formulas: </p>
<div class="math">$$cov(X,Y)=\frac{1}{n}\sum_{i=1}^{n}(x_i-\bar{x})\cdot(y_i-\bar{y})$$</div>
<p>or </p>
<div class="math">$$cov(X,Y)=\frac{1}{n^2}\sum_{i=1}^{n}\sum_{j=1}^{n}\frac{1}{2}(x_i-x_j)\cdot(y_i-y_j))$$</div>
<div class="math">$$cov(X,Y)=\frac{1}{n^2}\sum_{i}\sum_{j\gt i}^{n}(x_i-x_j)\cdot(y_i-y_j)$$</div>
<p>where, <span class="math">\(\bar{x}\)</span> is the mean of <span class="math">\(X\)</span> (or <span class="math">\(\mu_X\)</span>) and <span class="math">\(\bar{y}\)</span> is the mean of <span class="math">\(Y\)</span> (or <span class="math">\(\mu_Y\)</span>)</p>
<h2>Pearson correlation coefficient</h2>
<p>The pearson correlation coefficient, <span class="math">\(\rho_{X,Y}\)</span>, is given by : </p>
<div class="math">$$\rho_{X,Y}=\frac{cov(X,Y)}{\sigma_X\sigma_Y}=\frac{\sum_{i}(x_i-\bar{x})(y_i-\bar{y})}{n\sigma_X\sigma_Y}$$</div>
<p>Here, <span class="math">\(\sigma_X\)</span> is the standard deviation of <span class="math">\(X\)</span> and <span class="math">\(\sigma_Y\)</span> is the standard deviation of <span class="math">\(Y\)</span>. You may also see <span class="math">\(\rho_{X,Y}\)</span> written as <span class="math">\(r_{X,Y}\)</span>.</p>
<p>The pearson correlation coefficient is a measure of the linear correlation between two variables X and Y.</p>
<script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
var align = "center",
indent = "0em",
linebreak = "false";
if (false) {
align = (screen.width < 768) ? "left" : align;
indent = (screen.width < 768) ? "0em" : indent;
linebreak = (screen.width < 768) ? 'true' : linebreak;
}
var mathjaxscript = document.createElement('script');
mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
mathjaxscript.type = 'text/javascript';
mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML';
mathjaxscript[(window.opera ? "innerHTML" : "text")] =
"MathJax.Hub.Config({" +
" config: ['MMLorHTML.js']," +
" TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," +
" jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
" extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
" displayAlign: '"+ align +"'," +
" displayIndent: '"+ indent +"'," +
" showMathMenu: true," +
" messageStyle: 'normal'," +
" tex2jax: { " +
" inlineMath: [ ['\\\\(','\\\\)'] ], " +
" displayMath: [ ['$$','$$'] ]," +
" processEscapes: true," +
" preview: 'TeX'," +
" }, " +
" 'HTML-CSS': { " +
" styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," +
" linebreaks: { automatic: "+ linebreak +", width: '90% container' }," +
" }, " +
"}); " +
"if ('default' !== 'default') {" +
"MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"}";
(document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}</script>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

View File

@ -222,7 +222,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

267
mathematics/spearman.html Normal file
View File

@ -0,0 +1,267 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<meta name="description" content="Data Science for Political and Social Phenomena">
<meta name="author" content="Guillaume Redoulès">
<link rel="icon" href="../favicon.ico">
<title>Spearman's Rank Correlation Coefficient - Mathematics</title>
<!-- JQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
window.jQuery || document.write('<script src="../theme/js/jquery.min.js"><\/script>')
</script>
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="../theme/css/bootstrap.css" />
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<link rel="stylesheet" type="text/css" href="../theme/css/ie10-viewport-bug-workaround.css" />
<!-- Custom styles for this template -->
<link rel="stylesheet" type="text/css" href="../theme/css/style.css" />
<link rel="stylesheet" type="text/css" href="../theme/css/notebooks.css" />
<link href='https://fonts.googleapis.com/css?family=PT+Serif:400,700|Roboto:400,500,700' rel='stylesheet' type='text/css'>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<meta name="tags" content="Statistics" />
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="..">Guillaume Redoulès</a>
</div>
<div class="navbar-collapse collapse" id="searchbar">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">About<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="../pages/about.html">About Guillaume</a></li>
<li><a href="https://github.com/redoules">GitHub</a></li>
<li><a href="https://www.linkedin.com/in/guillaume-redoul%C3%A8s-33923860/">LinkedIn</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Data Science<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="..#Blog">Blog</a></li>
<li><a href="..#Python">Python</a></li>
<li><a href="..#Bash">Bash</a></li>
<li><a href="..#SQL">SQL</a></li>
<li><a href="..#Mathematics">Mathematics</a></li>
<li><a href="..#Machine_Learning">Machine Learning</a></li>
<li><a href="..#Projects">Projects</a></li>
</ul>
</li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Projects<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="https://github.com/redoules/redoules.github.io">Notes (Github)</a></li>
</ul>
</li>
<!--<li class="dropdown">
<a href="../feeds/blog.rss.xml">Blog RSS</a>
</li>-->
</ul>
<form class="navbar-form" action="../search.html" onsubmit="return validateForm(this.elements['q'].value);">
<div class="form-group" style="display:inline;">
<div class="input-group" style="display:table;">
<span class="input-group-addon" style="width:1%;"><span class="glyphicon glyphicon-search"></span></span>
<input class="form-control search-query" name="q" id="tipue_search_input" placeholder="e.g. scikit KNN, pandas merge" required autocomplete="off" type="text">
</div>
</div>
</form>
</div>
<!--/.nav-collapse -->
</div>
</div>
<!-- end of header section -->
<div class="container">
<!-- <div class="alert alert-warning" role="alert">
Did you find this page useful? Please do me a quick favor and <a href="#" class="alert-link">endorse me for data science on LinkedIn</a>.
</div> -->
<section id="content" class="body">
<header>
<h1>
Spearman's Rank Correlation Coefficient
</h1>
<ol class="breadcrumb">
<li>
<time class="published" datetime="2018-11-14T22:09:00+01:00">
14 novembre 2018
</time>
</li>
<li>Mathematics</li>
<li>Statistics</li>
</ol>
</header>
<div class='article_content'>
<p>A rank correlation is any of several statistics that measure an ordinal association—the relationship between rankings of different ordinal variables or different rankings of the same variable, where a "ranking" is the assignment of the ordering labels "first", "second", "third", etc. to different observations of a particular variable. A rank correlation coefficient measures the degree of similarity between two rankings, and can be used to assess the significance of the relation between them. </p>
<p>We have two random variables <span class="math">\(X\)</span> and <span class="math">\(Y\)</span>:
<em> <span class="math">\(X=\{x_i, x_2, x_3, ..., x_n\}\)</span>
</em> <span class="math">\(Y=\{y_i, y_2, y_3, ..., y_n\}\)</span></p>
<p>if <span class="math">\(Rank_X\)</span> and <span class="math">\(Rank_Y\)</span> denote the respective ranks of each data point, then the Spearman's rank correlation coefficient, <span class="math">\(r_s\)</span>, is the Pearson correlation coefficient of <span class="math">\(Rank_X\)</span> and <span class="math">\(Rank_Y\)</span>.</p>
<h2>Example</h2>
<ul>
<li><span class="math">\(X=\{0.2, 1.3, 0.2, 1.1, 1.4, 1.5\}\)</span></li>
<li><span class="math">\(Y=\{1.9, 2.2, 3.1, 1.2, 2.2, 2.2\}\)</span></li>
</ul>
<div class="math">$$
Rank_X
\quad
\begin{bmatrix}
X: &amp; 0.2 &amp; 1.3 &amp; 0.2 &amp; 1.1 &amp; 1.4 &amp; 1.5 \\
Rank: &amp; 1 &amp; 3 &amp; 1 &amp; 2 &amp; 4 &amp; 5
\end{bmatrix}
\quad
$$</div>
<p>so, <span class="math">\(Rank_X = \{1, 3, 1, 2, 4, 5\}\)</span></p>
<p>similarly, <span class="math">\(Rank_Y=\{2,3,4,1,3,3\}\)</span></p>
<p><span class="math">\(r_s\)</span> equals the Pearson correlation coefficient of <span class="math">\(Rank_X\)</span> and <span class="math">\(Rank_Y\)</span>, meaning that <span class="math">\(r=0.158114\)</span></p>
<h2>Special case : <span class="math">\(X\)</span> and <span class="math">\(Y\)</span> don't contain duplicates</h2>
<div class="math">$$r_s=1-\frac{6\sum d_i^2}{n(n^2-1)}$$</div>
<p>Where, <span class="math">\(d_i\)</span> is the difference between the respective values of <span class="math">\(Rank_X\)</span> and <span class="math">\(Rank_Y\)</span>.</p>
<script type="text/javascript">if (!document.getElementById('mathjaxscript_pelican_#%@#$@#')) {
var align = "center",
indent = "0em",
linebreak = "false";
if (false) {
align = (screen.width < 768) ? "left" : align;
indent = (screen.width < 768) ? "0em" : indent;
linebreak = (screen.width < 768) ? 'true' : linebreak;
}
var mathjaxscript = document.createElement('script');
mathjaxscript.id = 'mathjaxscript_pelican_#%@#$@#';
mathjaxscript.type = 'text/javascript';
mathjaxscript.src = 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.3/latest.js?config=TeX-AMS-MML_HTMLorMML';
mathjaxscript[(window.opera ? "innerHTML" : "text")] =
"MathJax.Hub.Config({" +
" config: ['MMLorHTML.js']," +
" TeX: { extensions: ['AMSmath.js','AMSsymbols.js','noErrors.js','noUndefined.js'], equationNumbers: { autoNumber: 'AMS' } }," +
" jax: ['input/TeX','input/MathML','output/HTML-CSS']," +
" extensions: ['tex2jax.js','mml2jax.js','MathMenu.js','MathZoom.js']," +
" displayAlign: '"+ align +"'," +
" displayIndent: '"+ indent +"'," +
" showMathMenu: true," +
" messageStyle: 'normal'," +
" tex2jax: { " +
" inlineMath: [ ['\\\\(','\\\\)'] ], " +
" displayMath: [ ['$$','$$'] ]," +
" processEscapes: true," +
" preview: 'TeX'," +
" }, " +
" 'HTML-CSS': { " +
" styles: { '.MathJax_Display, .MathJax .mo, .MathJax .mi, .MathJax .mn': {color: 'inherit ! important'} }," +
" linebreaks: { automatic: "+ linebreak +", width: '90% container' }," +
" }, " +
"}); " +
"if ('default' !== 'default') {" +
"MathJax.Hub.Register.StartupHook('HTML-CSS Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax['HTML-CSS'].FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"MathJax.Hub.Register.StartupHook('SVG Jax Ready',function () {" +
"var VARIANT = MathJax.OutputJax.SVG.FONTDATA.VARIANT;" +
"VARIANT['normal'].fonts.unshift('MathJax_default');" +
"VARIANT['bold'].fonts.unshift('MathJax_default-bold');" +
"VARIANT['italic'].fonts.unshift('MathJax_default-italic');" +
"VARIANT['-tex-mathit'].fonts.unshift('MathJax_default-italic');" +
"});" +
"}";
(document.body || document.getElementsByTagName('head')[0]).appendChild(mathjaxscript);
}</script>
</div>
<aside>
<div class="bug-reporting__panel">
<h3>Find an error or bug? Have a suggestion?</h3>
<p>Everything on this site is avaliable on GitHub. Head on over and <a href='https://github.com/redoules/redoules.github.io/issues/new'>submit an issue.</a> You can also message me directly by <a href='mailto:guillaume.redoules@gadz.org'>email</a>.</p>
</div>
</aside>
</section>
</div>
<!-- start of footer section -->
<footer class="footer">
<div class="container">
<p class="text-muted">
<center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/>
Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>.
</center>
</p>
</div>
</footer>
<!-- This jQuery line finds any span that contains code highlighting classes and then selects the parent <pre> tag and adds a border. This is done as a workaround to visually distinguish the code inputs and outputs -->
<script>
$( ".hll, .n, .c, .err, .k, .o, .cm, .cp, .c1, .cs, .gd, .ge, .gr, .gh, .gi, .go, .gp, .gs, .gu, .gt, .kc, .kd, .kn, .kp, .kr, .kt, .m, .s, .na, .nb, .nc, .no, .nd, .ni, .ne, .nf, .nl, .nn, .nt, .nv, .ow, .w, .mf, .mh, .mi, .mo, .sb, .sc, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss, .bp, .vc, .vg, .vi, .il" ).parent( "pre" ).css( "border", "1px solid #DEDEDE" );
</script>
<!-- Load Google Analytics -->
<script>
/*
(function(i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r;
i[r] = i[r] || function() {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date();
a = s.createElement(o),
m = s.getElementsByTagName(o)[0];
a.async = 1;
a.src = g;
m.parentNode.insertBefore(a, m)
})(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-66582-32', 'auto');
ga('send', 'pageview');
*/
</script>
<!-- End of Google Analytics -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../theme/js/bootstrap.min.js"></script>
<!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
<script src="../theme/js/ie10-viewport-bug-workaround.js"></script>
</body>
</html>

View File

@ -145,7 +145,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -241,7 +241,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -235,7 +235,7 @@ At line 5 there is a plum which is purple and contains 28 kcal
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -378,7 +378,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -168,7 +168,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@ If you try to open a non existing file in read mode 'r', a FileNotFoundError wil
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -176,7 +176,7 @@ conda install numpy --channel intel --override-channels
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -237,7 +237,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -186,7 +186,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -171,7 +171,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -339,7 +339,7 @@ However, exporting to a sql database can prove very useful. Indeed, having a wel
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -181,7 +181,7 @@ The number 4 appears 1 times in the list
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -338,7 +338,7 @@ http://127.0.0.1:8787/status</p>
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -148,7 +148,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -232,7 +232,7 @@ The list of dependencies required to test, build and generate the doc are listed
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -164,7 +164,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -218,7 +218,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -177,7 +177,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -213,7 +213,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -248,7 +248,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -173,7 +173,7 @@ Reversed array : [4 3 2 1 0]
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -192,7 +192,7 @@ Sorted array : [0.13876208 0.19939047 0.40021786 0.43734158 0.46015169]
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -381,7 +381,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -171,7 +171,7 @@ Numpy array with unique values : [10 20 30 40 50 60]
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -151,7 +151,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -112,7 +112,7 @@
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -5,7 +5,7 @@ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url> <url>
<loc>redoules.github.io/</loc> <loc>redoules.github.io/</loc>
<lastmod>2018-11-13T22:55:05-00:00</lastmod> <lastmod>2018-11-14T22:49:18-00:00</lastmod>
<changefreq>daily</changefreq> <changefreq>daily</changefreq>
<priority>0.5</priority> <priority>0.5</priority>
</url> </url>
@ -17,6 +17,20 @@ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<priority>0.5</priority> <priority>0.5</priority>
</url> </url>
<url>
<loc>redoules.github.io/mathematics/spearman.html</loc>
<lastmod>2018-11-14T22:09:00+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url>
<loc>redoules.github.io/mathematics/pearson.html</loc>
<lastmod>2018-11-14T21:21:00+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url> <url>
<loc>redoules.github.io/blog/Statistics_10days-day6.html</loc> <loc>redoules.github.io/blog/Statistics_10days-day6.html</loc>
<lastmod>2018-11-13T22:15:00+01:00</lastmod> <lastmod>2018-11-13T22:15:00+01:00</lastmod>
@ -24,6 +38,13 @@ xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<priority>0.5</priority> <priority>0.5</priority>
</url> </url>
<url>
<loc>redoules.github.io/blog/Statistics_10days-day7.html</loc>
<lastmod>2018-11-13T21:18:00+01:00</lastmod>
<changefreq>monthly</changefreq>
<priority>0.5</priority>
</url>
<url> <url>
<loc>redoules.github.io/blog/Statistics_10days-day5.html</loc> <loc>redoules.github.io/blog/Statistics_10days-day5.html</loc>
<lastmod>2018-11-12T13:07:00+01:00</lastmod> <lastmod>2018-11-12T13:07:00+01:00</lastmod>

View File

@ -344,7 +344,7 @@ Done.
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -631,7 +631,7 @@ Done.
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -216,7 +216,7 @@ Done.
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

View File

@ -346,7 +346,7 @@ Done.
<footer class="footer"> <footer class="footer">
<div class="container"> <div class="container">
<p class="text-muted"> <p class="text-muted">
<center>This project contains 60 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>. <center>This project contains 63 pages and is available on <a href="https://github.com/redoules/redoules.github.io">GitHub</a>.
<br/> <br/>
Copyright &copy; Guillaume Redoulès, Copyright &copy; Guillaume Redoulès,
<time datetime="2018">2018</time>. <time datetime="2018">2018</time>.

File diff suppressed because one or more lines are too long