<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Coder Legion - Recent posts tagged statistics</title>
<link>https://coderlegion.com/tag/statistics</link>
<description>Powered by Question2Answer</description>
<item>
<title>Statistical Arbitrage &amp; Cointegration in LATAM Equities (BVC) with Python</title>
<link>https://coderlegion.com/30940/statistical-arbitrage-cointegration-in-latam-equities-bvc-with-python</link>
<description>&lt;p&gt;Two stocks can rise together for years and still be untradeable as a pair. Correlation measures co-movement; pairs trading needs &lt;strong&gt;cointegration&lt;/strong&gt; — a stationary, mean-reverting spread. This post builds the standard test pipeline in Python and shows where most LATAM pairs fail.&lt;/p&gt;
&lt;p&gt;Educational content: methodology, no signals, no return claims.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;1-correlation-lies-cointegration-trades&quot;&gt;1. Correlation Lies, Cointegration Trades&lt;/h3&gt;
&lt;p&gt;Correlated prices drift apart permanently (both trend up, spread widens forever). A cointegrated pair has a spread that reverts to a stable mean, which is what a long/short entry bets on. The Engle–Granger (1987) two-step procedure tests exactly this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Regress Y on X by OLS → hedge ratio β.&lt;/li&gt;
&lt;li&gt;Run an Augmented Dickey–Fuller (ADF) test on the residual spread. Only a &lt;strong&gt;stationary&lt;/strong&gt; spread (low ADF p-value) is tradeable.&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;import numpy as np
import statsmodels.api as sm
from statsmodels.tsa.stattools import coint, adfuller

# y, x: aligned log-price series of the two candidate assets
score, pvalue, _ = coint(y, x)          # Engle-Granger cointegration test
print(f&quot;EG p-value: {pvalue:.4f}&quot;)      # tradeable only if clearly &amp;lt; 0.05

res = sm.OLS(y, sm.add_constant(x)).fit()
beta = res.params[1]                    # hedge ratio: short beta units of X per 1 of Y
spread = y - beta * x

adf_stat, adf_p, *_ = adfuller(spread)[:2]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;A p-value above conventional significance is not a &quot;weak pair&quot; — it is a &lt;strong&gt;rejection&lt;/strong&gt;. Discard it. Most random pairs fail; that is the expected outcome, not bad luck. (Our falsification-first protocol for backtests is documented in &lt;a rel=&quot;nofollow&quot; href=&quot;https://coderlegion.com/26601/why-perfect-backtests-fail-walk-forward-optimization-and-deflated-sharpe-in-python&quot;&gt;Why Perfect Backtests Fail&lt;/a&gt;.)&lt;/p&gt;
&lt;h3 id=&quot;2-half-life-how-fast-does-it-revert-&quot;&gt;2. Half-Life: How Fast Does It Revert?&lt;/h3&gt;
&lt;p&gt;A stationary spread that reverts once a year is untradeable. Estimate the half-life with a simple AR(1) regression of spread changes on lagged spread:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;d_spread = np.diff(spread)
lag = spread[:-1]
beta_hl = np.polyfit(lag, d_spread, 1)[0]
halflife = -np.log(2) / beta_hl
print(f&quot;Half-life: {halflife:.1f} bars&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Practical rule: half-life should sit comfortably between transaction-cost frequency (too fast = costs eat everything) and your holding horizon (too slow = capital sits idle). Both extremes fail — for opposite reasons.&lt;/p&gt;
&lt;h3 id=&quot;3-entries-on-the-z-score-exits-on-discipline&quot;&gt;3. Entries on the Z-Score, Exits on Discipline&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-python&quot;&gt;z = (spread - spread.mean()) / spread.std()
# Enter when |z| &amp;gt; 2.0 (long the laggard, short the leader),
# exit when z crosses back through ~0.25 — never &quot;wait for full reversion&quot;.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hard stops still apply: cointegration &lt;strong&gt;breaks&lt;/strong&gt; (mergers, regime changes, delistings). A pair that held for three years can decouple in a week. Size every pair as if the spread can go to 3–4σ and stay there.&lt;/p&gt;
&lt;h3 id=&quot;4-why-latam-bvc-pairs-are-harder&quot;&gt;4. Why LATAM (BVC) Pairs Are Harder&lt;/h3&gt;
&lt;p&gt;Applying this to Colombian equities (BVC) adds three frictions US textbook examples ignore:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Liquidity:&lt;/strong&gt; wider spreads and thin books mean your backtest fill assumptions are fiction unless you model slippage explicitly. Test with volume-capped fills.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Costs:&lt;/strong&gt; commissions, exchange fees and taxes compound on a strategy that trades often. Recompute the half-life economics &lt;em&gt;after&lt;/em&gt; costs — many &quot;profitable&quot; spreads die here.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Short access:&lt;/strong&gt; pairs trading needs both legs. If you cannot reliably short one side, the strategy is long-only spread timing, a different (usually worse) trade. Verify borrow availability before any capital.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;No specific pairs are recommended here — universes change, and any named pair would be stale on arrival. Run the pipeline above on current data instead.&lt;/p&gt;
&lt;h3 id=&quot;5-validation-checklist&quot;&gt;5. Validation Checklist&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;In-sample cointegration + out-of-sample spread stability (Walk-Forward, not one fit).&lt;/li&gt;
&lt;li&gt;Half-life compatible with costs and horizon.&lt;/li&gt;
&lt;li&gt;Break scenario sized and stop-defined before the first trade.&lt;/li&gt;
&lt;li&gt;60+ days paper trading the exact execution path.&lt;/li&gt;
&lt;/ol&gt;
&lt;hr&gt;
&lt;p&gt;&lt;em&gt;Study material under Colombia SFC Decreto 2555 de 2010 — financial-engineering education, not investment advice. No signals, no managed accounts.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;By &lt;strong&gt;Mahdi Goodarzi&lt;/strong&gt; (&lt;a rel=&quot;nofollow&quot; href=&quot;https://g.dev/mahdigoodarzi&quot;&gt;g.dev/mahdigoodarzi&lt;/a&gt;), Gueta Quant — research notes at &lt;a rel=&quot;nofollow&quot; href=&quot;https://guetaquant.com/blog/&quot;&gt;guetaquant.com/blog&lt;/a&gt;. Related: &lt;a rel=&quot;nofollow&quot; href=&quot;https://guetaquant.com/pine-script-v6/&quot;&gt;Pine Script v6 guide&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/30940/statistical-arbitrage-cointegration-in-latam-equities-bvc-with-python</guid>
<pubDate>Tue, 13 Oct 2026 13:33:11 +0000</pubDate>
</item>
<item>
<title>The Parts Of Scientific Work That Are Really Software Problems</title>
<link>https://coderlegion.com/25879/the-parts-of-scientific-work-that-are-really-software-problems</link>
<description>&lt;p&gt;Most of us here write software for products, but a surprising amount of the same work happens in labs and research groups, written by people who were never taught to write code. If you have ever inherited a research script and wondered why it does what it does, this one is for you.&lt;/p&gt;
&lt;h3 id=&quot;where-research-code-actually-breaks&quot;&gt;Where Research Code Actually Breaks&lt;/h3&gt;
&lt;p&gt;Research code fails differently from product code. It rarely crashes in a way anyone notices. It quietly produces a number, and the number is wrong because a filter was applied twice, or a merge silently dropped half the rows, or a random seed moved between runs.&lt;/p&gt;
&lt;p&gt;The habits that catch this are the ones we already use: keep the raw data immutable, make every transform a named step you can rerun from scratch, and check row counts before and after every join. A pipeline that prints how many records survived each stage catches more errors than any amount of careful reading.&lt;/p&gt;
&lt;h3 id=&quot;statistics-is-a-modeling-problem-not-a-library-problem&quot;&gt;Statistics Is A Modeling Problem, Not A Library Problem&lt;/h3&gt;
&lt;p&gt;Calling a t-test is one line in any language. Knowing that a t-test is the wrong tool for your data is the actual work, and no library will tell you.&lt;/p&gt;
&lt;p&gt;The questions that matter come before the function call: what is the unit of observation, are the observations independent, how many comparisons are you running, and what effect size would actually mean something. Get those wrong and a perfectly correct implementation returns a perfectly meaningless p value.&lt;/p&gt;
&lt;h3 id=&quot;reading-a-paper-like-a-code-review&quot;&gt;Reading A Paper Like A Code Review&lt;/h3&gt;
&lt;p&gt;A paper is a claim plus the evidence for it, and it can be reviewed the same way you review a pull request. Read the methods before the results, because the methods tell you what the results are allowed to mean.&lt;/p&gt;
&lt;p&gt;Then check the sample size, look for the comparison that is missing, and see whether the conclusion in the abstract is the same one the data supports. This is a skill, not a talent, and it improves fast once you start doing it deliberately. We keep the practical side of all of this collected in one place, &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.learnhowtoscience.com/data-and-methods/&quot;&gt;the tools and methods behind real science&lt;/a&gt;, covering Python for scientific work, statistics, scientific computing, algorithms, experiment design, research methods and how to read a paper properly.&lt;/p&gt;
&lt;h3 id=&quot;the-takeaway&quot;&gt;The Takeaway&lt;/h3&gt;
&lt;p&gt;Scientific work and software work fail in the same places: unclear inputs, unstated assumptions, and results nobody can reproduce. If you already have the engineering instincts, most of what separates you from doing real analysis is vocabulary, and that part is learnable in an afternoon.&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/25879/the-parts-of-scientific-work-that-are-really-software-problems</guid>
<pubDate>Sun, 30 Aug 2026 21:45:55 +0000</pubDate>
</item>
<item>
<title>Skaylar - Analyze datasets</title>
<link>https://coderlegion.com/25220/skaylar-analyze-datasets</link>
<description>&lt;h2 id=&quot;skaylar&quot;&gt;Skaylar&lt;/h2&gt;
&lt;h4 id=&quot;find-what-doesn-t-add-up&quot;&gt;Find what doesn't add up&lt;/h4&gt;
&lt;p&gt;Skaylar is a simple, web-based tool for forensic data analysis using Benford's Law to analyze and visualize first-digit distributions in a dataset. &lt;br&gt;
Paste the data, click Run Test, and instantly see if there are anomalies.&lt;/p&gt;
&lt;p&gt;&lt;img width=&quot;720&quot; height=&quot;1264&quot; alt=&quot;1001548566&quot; src=&quot;https://github.com/user-attachments/assets/fe5a3655-4b7d-4c9a-8821-910684c53f58&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Benford's Law showing population of countries (1970, 1980, 1990, 2000, 2010, 2015, 2020, 2022)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;hr&gt;
&lt;h3 id=&quot;what-is-benford-s-law-&quot;&gt;What is Benford's Law?&lt;/h3&gt;
&lt;p&gt;In real financial data, the digit &quot;1&quot; appears as the first digit ~30% of the time, &quot;2&quot; ~18%, etc.&lt;br&gt;
If your data deviates too much, it can signal fraud, errors, or manipulation.&lt;br&gt;
Skaylar checks this for you in seconds.&lt;/p&gt;
&lt;h3 id=&quot;how-to-use&quot;&gt;How to Use&lt;/h3&gt;
&lt;h4 id=&quot;1-visit-the-website-or-download-the-repo-offline-use-&quot;&gt;1. Visit the &lt;a rel=&quot;nofollow&quot; href=&quot;https://temi-tade.github.io/Skaylar&quot;&gt;website&lt;/a&gt; or download the repo (offline use):&lt;/h4&gt;
&lt;p&gt;&lt;code&gt;git clone https://github.com/Temi-Tade/Skaylar.git&lt;/code&gt;&lt;br&gt;
or click &lt;code&gt;Code &amp;gt; Download ZIP&lt;/code&gt; and extract files on your computer.&lt;/p&gt;
&lt;h4 id=&quot;2-open&quot;&gt;2. Open&lt;/h4&gt;
&lt;p&gt;Double-click &lt;code&gt;index.html&lt;/code&gt; &lt;br&gt;
Works in Chrome, Edge, Firefox, and on mobile.&lt;/p&gt;
&lt;h4 id=&quot;3-analyze&quot;&gt;3. Analyze&lt;/h4&gt;
&lt;ol&gt;
&lt;li&gt;Input/Paste your numbers in the textbox or Click &lt;code&gt;Select Dataset&lt;/code&gt; to select/upload a .json dataset. Numbers in the textbox should be delimited by commas, spaces or new lines&lt;/li&gt;
&lt;li&gt;Click &lt;code&gt;Run Test&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;View the results table and graph&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id=&quot;what-you-get&quot;&gt;What You Get&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Results Table&lt;/strong&gt;: Expected % vs Actual % for digits 1-9 and deviations&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Graph&lt;/strong&gt;: Visual comparison to spot deviations fast&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Analytics&lt;/strong&gt;: Max deviation and Chi square value.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img width=&quot;720&quot; height=&quot;1307&quot; alt=&quot;1001549146&quot; src=&quot;https://github.com/user-attachments/assets/6bfd0660-b7c4-4b32-b2d4-4ee5ca07767f&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Height distribution (Does not follow Benford's Law)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img width=&quot;720&quot; height=&quot;1425&quot; alt=&quot;1001548580&quot; src=&quot;https://github.com/user-attachments/assets/6b5d9fb9-662d-4cba-9daa-b14e2b1d5583&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Fibonacci series (Follows Benford's Law)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;what-you-can-do&quot;&gt;What you can do&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Customize Graph&lt;/strong&gt;: Change colour of expected and actual curves on the graph. Also, you can scale the graph to different zoom levels.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Save Datasets&lt;/strong&gt;: Save a Dataset that you manually pasted/inputted in the text box as a .json file that you can share with other people.&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;&lt;img width=&quot;720&quot; height=&quot;1001&quot; alt=&quot;1001566664&quot; src=&quot;https://github.com/user-attachments/assets/c1a5aea6-977e-4cbc-8aaf-4d9893aae499&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Save manually-inputted data as a .json Dataset file.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;img width=&quot;720&quot; height=&quot;533&quot; alt=&quot;1001564779&quot; src=&quot;https://github.com/user-attachments/assets/ccc79e47-6506-4fb8-a12d-6dbbb74340a1&quot;&gt;&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;Customize curve colours on the graph and adjust zoom levels.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3 id=&quot;contribute-to-skaylar&quot;&gt;Contribute to Skaylar&lt;/h3&gt;
&lt;p&gt;Skaylar is open source and is open to contribution from developers, data scientists/analysts, forensic accountants, auditors and anyone interested in making it better.&lt;/p&gt;
&lt;h4 id=&quot;contribution-guidelines&quot;&gt;Contribution Guidelines&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Fork the repo and make your improvements/additions/fixes.&lt;/li&gt;
&lt;li&gt;Check out the issues tab on the repo if you are confused in where to start from.&lt;/li&gt;
&lt;li&gt;Create a Pull Request from your forked repo.&lt;/li&gt;
&lt;li&gt;Your PR will be reviewed and merged accordingly.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;&lt;p&gt;You can also contribute by adding datasets for users to test Skaylar. The datasets are .json files and should strictly follow the format below:&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&quot;language-json&quot;&gt;{
    &quot;name&quot;: &quot;Name of the dataset&quot;, // recommended: separate words with underscores 
    &quot;description&quot;: &quot;Description of the dataset&quot;,
    &quot;source&quot;: &quot;Verified and official source&quot;, // You can put your name if you scrapped the data yourself 
    &quot;data&quot;: [120, 300] // array of the numbers in the dataset
}

&lt;/code&gt;&lt;/pre&gt;
</description>
<category>Launches</category>
<guid isPermaLink="true">https://coderlegion.com/25220/skaylar-analyze-datasets</guid>
<pubDate>Mon, 24 Aug 2026 05:49:07 +0000</pubDate>
</item>
<item>
<title>Juniors Don't Love Rust — You Just Can't Separate Age From Year From Cohort</title>
<link>https://coderlegion.com/23272/juniors-dont-love-rust-you-just-cant-separate-age-from-year-from-cohort</link>
<description>&lt;blockquote&gt;&lt;p&gt;Originally published at &lt;a rel=&quot;nofollow&quot; href=&quot;https://vibeagentmaking.com/blog/juniors-don-t-love-rust-you-just-can-t-separate-age-from-yea/&quot;&gt;https://vibeagentmaking.com/blog/juniors-don-t-love-rust-you-just-can-t-separate-age-from-yea/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;em&gt;An APC teardown of the Stack Overflow Developer Survey. The numbers are real; the story about &lt;/em&gt;who&lt;em&gt; was always optional, and one line of century-old arithmetic shows exactly why a survey like this can never pin it down.&lt;/em&gt;&lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;In June 2022, Stack Overflow published its annual developer survey and handed the internet a headline it had printed six times before: Rust was the &quot;most loved&quot; programming language, for the seventh year in a row, with 87% of its users saying they wanted to keep using it. When the survey retired &quot;loved&quot; for the sterner &quot;admired&quot; in 2023, Rust just kept winning: 83% admired in 2024 (&quot;for the second year in a row,&quot; as Stack Overflow's own write-up put it), 72% and still #1 in 2025.&lt;/p&gt;
&lt;p&gt;You have read the think-piece this figure generates. You may have written it. It goes: &lt;em&gt;young developers love Rust&lt;/em&gt;. Juniors chase memory safety the way their elders chased garbage collection; the kids grew up on the borrow checker; Gen Z devs are built different. It comes with a chart, the chart goes up and to the right, and the conclusion feels like it is sitting right there in the data.&lt;/p&gt;
&lt;p&gt;Here is the uncomfortable thing I want to show you, with arithmetic: that conclusion is not in the data. Not because the sample is too small, or self-selected (though it is), or because correlation is not causation. Something sharper. The dataset, any dataset shaped like this one, is &lt;em&gt;mathematically incapable&lt;/em&gt; of telling you whether young people drive a trend. The proof is one line long, it is about a century old in demography, and once you see it you will spot undeclared versions of it in half the trend pieces you read.&lt;/p&gt;
&lt;h3 id=&quot;one-line-of-arithmetic-three-incompatible-stories&quot;&gt;One line of arithmetic, three incompatible stories&lt;/h3&gt;
&lt;p&gt;The Stack Overflow survey is what statisticians call a repeated cross-section: every year, a fresh pile of respondents, each row carrying an age bucket and a survey year. From those two fields you can derive a third: roughly, birth year, or, closer to what tech punditry actually means, the year this person &lt;em&gt;entered the field&lt;/em&gt;. Demographers call these three clocks &lt;strong&gt;age&lt;/strong&gt;, &lt;strong&gt;period&lt;/strong&gt;, and &lt;strong&gt;cohort&lt;/strong&gt;, and every generational claim is a claim about which clock is doing the work:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Age effect:&lt;/strong&gt; juniors try new things; people cool on novelty as they age. (&quot;Juniors love Rust.&quot;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Period effect:&lt;/strong&gt; a moment pulled everyone in at once, regardless of age. (&quot;2023 changed everything.&quot;)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cohort effect:&lt;/strong&gt; the class that entered around 2021 imprinted on the tool and will carry it forever. (&quot;This generation is different.&quot;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The trap is that the three clocks are not three measurements. &lt;strong&gt;Cohort = period − age.&lt;/strong&gt; Exactly. Know any two and you know the third, which means a model trying to estimate all three is asking the data to split one number three ways.&lt;/p&gt;
&lt;p&gt;This is the &lt;strong&gt;age-period-cohort identification problem&lt;/strong&gt;, and it is not a folk worry; it is a theorem about the geometry of the question. Put a variable for age, a variable for survey year, and a variable for cohort into one regression and the design matrix is rank-deficient by exactly one: its columns are linearly dependent, and infinitely many different coefficient vectors reproduce the observed data &lt;em&gt;identically&lt;/em&gt;, not approximately but identically. More respondents do not help. A bigger survey sharpens every one of the competing answers equally and leaves them exactly as tied. The ambiguity lives in the question, not the noise.&lt;/p&gt;
&lt;h3 id=&quot;running-it-for-real&quot;&gt;Running it for real&lt;/h3&gt;
&lt;p&gt;Claims like that deserve a demonstration, so let us run one on the survey's cleanest curve. Stack Overflow started asking about AI tools in 2023, and the topline is famous: &lt;strong&gt;70%&lt;/strong&gt; of respondents using or planning to use AI tools in 2023, &lt;strong&gt;76%&lt;/strong&gt; in 2024, &lt;strong&gt;84%&lt;/strong&gt; in 2025.&lt;/p&gt;
&lt;p&gt;Fit the linear age-period-cohort model and ask the standard software for &lt;em&gt;the&lt;/em&gt; answer, three different runs, three different constraint choices. Read the rows as headlines. One says the trend is &lt;em&gt;all&lt;/em&gt; age and cohort: the generational story, +7 points a step each. One says it is &lt;em&gt;all&lt;/em&gt; the moment: ChatGPT year, everyone at once, no generation involved. The diplomatic compromise a fancy estimator produces splits it 2.33 / 4.67 / 2.33 and looks, to the untrained eye, like a &lt;em&gt;finding&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;The punchline: across every cell of the grid, the three fits differ by zero. Not &quot;within confidence intervals.&quot; Zero, to machine precision. They are the same surface wearing three stories, because the reallocation between them (add δ to the age slope, subtract δ from the period slope, add δ to the cohort slope) cancels exactly, for any δ, forever. That is the rank deficiency made flesh: four columns, rank three.&lt;/p&gt;
&lt;p&gt;In 2004, Yang, Fu and Land published the &lt;strong&gt;Intrinsic Estimator&lt;/strong&gt; in &lt;em&gt;Sociological Methodology&lt;/em&gt;, a principled-sounding fix that uses a pseudoinverse to pick, out of the infinite family of equally-fitting answers, the unique one orthogonal to the null space of the design matrix. It has lovely statistical properties. It is also &lt;em&gt;a choice&lt;/em&gt;: one member of the tied family, selected by a criterion that has nothing to do with how developers actually adopt tools. In 2013, Andrew Bell and Kelvyn Jones published a paper in &lt;em&gt;Social Science &amp;amp; Medicine&lt;/em&gt; whose title states the thesis with admirable bluntness: &quot;The impossibility of separating age, period and cohort effects.&quot; &lt;em&gt;No&lt;/em&gt; estimator solves this, because the problem is inherent to the real-world process, not the statistics. The fanciest estimator is not the one that found the answer. It is the one that best disguised the assumption.&lt;/p&gt;
&lt;h3 id=&quot;what-the-data-can-say&quot;&gt;What the data &lt;em&gt;can&lt;/em&gt; say&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;Within one survey year, age comparisons are fine.&lt;/strong&gt; If 2025's 18-to-24-year-olds admire Rust more than 2025's 45-year-olds, that is an observable fact, a cross-sectional gradient, no identification problem at all. What you cannot do is attribute the &lt;em&gt;drift across years&lt;/em&gt; to any one clock.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Curvature survives. Straight lines don't.&lt;/strong&gt; The unidentifiable piece is exactly the shared &lt;em&gt;linear&lt;/em&gt; trend, the smooth drift. Kinks, spikes, accelerations, the second-difference structure, are identified, because reallocating a straight line among three clocks cannot manufacture or absorb a corner. In the AI curve, 70 to 76 to 84 is +6 then +8. The acceleration, +2 points, came out identical in every fit, under every constraint. The &lt;em&gt;near-vertical jump the year ChatGPT broke&lt;/em&gt; is real, attributable, and visibly a period shock: everyone, every age bucket, at once.&lt;/p&gt;
&lt;p&gt;Sit with the irony of that. The one thing this dataset can actually pin down, &quot;a moment moved everybody,&quot; is the &lt;em&gt;least&lt;/em&gt; generational story available. The moment a narrative becomes interesting (&quot;this cohort is different&quot;) is precisely the moment it slides into the unidentifiable linear subspace. The seductiveness and the unprovability are the same mathematical property.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;And there is a fourth clock nobody models.&lt;/strong&gt; Stack Overflow's 2024 write-up notes that respondents aged 35 and up were 31% of the sample in 2022, 35% in 2023, and 39% in 2024. This is a self-selected convenience sample that re-draws itself every year. A composition shift like that can manufacture, mask, or reverse any apparent trend on any of the three clocks, before we even reach the theorem.&lt;/p&gt;
&lt;h3 id=&quot;the-grown-up-in-the-room-already-blinked&quot;&gt;The grown-up in the room already blinked&lt;/h3&gt;
&lt;p&gt;In May 2023, Pew Research Center published a methodological statement titled &quot;How Pew Research Center Will Report on Generations Moving Forward.&quot; In it, they concede the core point: when younger adults answer differently than older ones, &quot;it may be driven by their demographic traits rather than the fact that they belong to a particular generation.&quot; Their new house rules: generational claims require decades of comparable historical data, and where the label is not earned, they will group by decade or event instead.&lt;/p&gt;
&lt;p&gt;A century of theory sits behind that retreat. Karl Mannheim's 1928 essay &quot;The Problem of Generations&quot; was already more careful than the genre it spawned: sharing birth years creates only a &lt;em&gt;potential&lt;/em&gt; for shared consciousness, and no generation is a homogeneous block. When a survey house of Pew's stature stops writing &quot;Gen Z believes…&quot; headlines from single-year cross-sections, that is a detector being honest about what it can detect.&lt;/p&gt;
&lt;h3 id=&quot;what-to-actually-do-with-this&quot;&gt;What to actually do with this&lt;/h3&gt;
&lt;p&gt;The practical insight is not &quot;never trust surveys.&quot; It is a one-question audit you can run on any trend claim, others' or your own, in about ten seconds:&lt;/p&gt;
&lt;blockquote&gt;&lt;p&gt;&quot;Which clock did you zero, and where did you say so?&quot;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Every attribution of a repeated-cross-section trend to age, generation, or moment has zeroed at least one clock. There is no exception; the algebra does not permit one. From there, three habits:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Downgrade smooth stories, respect kinks.&lt;/strong&gt; A gradual &quot;each cohort more than the last&quot; drift is exactly the unattributable shape. A sharp everyone-at-once jump carries real, identifiable period signal.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Check the composition clock first.&lt;/strong&gt; A survey whose 35+ share climbs 31 to 35 to 39 in two years can produce &quot;trends&quot; without a single human changing their mind.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;When you must attribute, declare the assumption and defend it from outside the data.&lt;/strong&gt; &quot;We attribute this to cohort because switching costs lock tool choices in the first two working years&quot; is an argument: checkable, arguable, honest.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And if you are the one writing the analysis: say the null proudly. &quot;This survey cannot tell whether juniors drive Rust adoption&quot; is not a failure to find a result. It &lt;em&gt;is&lt;/em&gt; the result. The numbers are real: 87%, seven years running, 83%, 72%, 70-76-84. What is optional, what was always optional, is the story about who.&lt;/p&gt;
&lt;p&gt;Anyone who tells you otherwise has made an assumption. The good ones tell you which.&lt;/p&gt;
&lt;hr&gt;
&lt;h3 id=&quot;sources&quot;&gt;Sources&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Stack Overflow, 2022 Developer Survey&lt;/strong&gt; — Rust &quot;most loved&quot; for the seventh consecutive year, 87%.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stack Overflow Blog (Jan 2025), &quot;Developers want more, more, more: the 2024 results&quot;&lt;/strong&gt; — Rust 83% admired; respondents 35+ = 31% (2022) to 35% (2023) to 39% (2024); AI use 76%.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stack Overflow, 2025 Developer Survey&lt;/strong&gt; — Rust most admired at 72%; 84% using or planning to use AI tools.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Stack Overflow, 2023 Developer Survey&lt;/strong&gt; — 70% of all respondents using or planning to use AI tools.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Bell, A., &amp;amp; Jones, K. (2013).&lt;/strong&gt; &quot;The impossibility of separating age, period and cohort effects.&quot; &lt;em&gt;Social Science &amp;amp; Medicine&lt;/em&gt;, 93, 163–165.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Yang, Y., Fu, W. J., &amp;amp; Land, K. C. (2004).&lt;/strong&gt; &quot;A Methodological Comparison of Age-Period-Cohort Models.&quot; &lt;em&gt;Sociological Methodology&lt;/em&gt;, 34, 75–110.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pew Research Center (May 2023).&lt;/strong&gt; &quot;How Pew Research Center Will Report on Generations Moving Forward.&quot;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Mannheim, K. (1928/1952).&lt;/strong&gt; &quot;The Problem of Generations.&quot;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;p&gt;Originally published at &lt;a rel=&quot;nofollow&quot; href=&quot;https://vibeagentmaking.com/blog/juniors-don-t-love-rust-you-just-can-t-separate-age-from-yea/&quot;&gt;https://vibeagentmaking.com/blog/juniors-don-t-love-rust-you-just-can-t-separate-age-from-yea/&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/23272/juniors-dont-love-rust-you-just-cant-separate-age-from-year-from-cohort</guid>
<pubDate>Wed, 22 Jul 2026 17:09:35 +0000</pubDate>
</item>
<item>
<title>Humble proof of Machine Learning &amp; Deep Leaning: Across 10 families and 100 Models.</title>
<link>https://coderlegion.com/11604/humble-proof-of-machine-learning-deep-leaning-across-10-families-and-100-models</link>
<description>&lt;h2 id=&quot;-elite-engineering-in-less-than-36-hours-&quot;&gt;&quot;Elite Engineering in less than 36 hours!&quot;&lt;/h2&gt;
&lt;p&gt;Best for: Experienced developers who value raw performance and terminal-heavy builds.&lt;/p&gt;
&lt;p&gt;Subject: Architecting the &quot;King Model&quot; Gauntlet: Stop letting AI get lazy.&lt;/p&gt;
&lt;p&gt;I’ve just pushed Project A-Z to my repo. It’s an end-to-end autonomous ML pipeline, but with a twist that most &quot;Auto-ML&quot; tools miss: Transparency through destruction.&lt;/p&gt;
&lt;p&gt;Early in the build, the AI engine was trying to cut corners—treating the stack like a simple script. I had to turn the tables. I shifted the entire architecture to a Terminal-First Tournament.&lt;/p&gt;
&lt;p&gt;If you run this, your PowerShell becomes a graveyard. You’ll see the &quot;Death Row&quot; of rejected models—KNNs, Naive Bayes, SVMS—logged with their failure metrics before the GUI even initializes. We’re moving past the &quot;black box&quot; and back to Scientific Benchmarking.&lt;/p&gt;
&lt;p&gt;The Spec:&lt;/p&gt;
&lt;p&gt;Wrangling: MICE + Isolation Forest for outlier pruning.&lt;/p&gt;
&lt;p&gt;Taxonomy: A gauntlet of 100+ model variants (Bagging, Boosting, Kernels).&lt;/p&gt;
&lt;p&gt;Visualization: Streamlit-powered post-mortem and &quot;What-If&quot; causal simulator.&lt;/p&gt;
&lt;p&gt;The GUI is just the cosmetics; the PowerShell is where the war is won. Check the proofs in the repo.&lt;/p&gt;
&lt;p&gt;Stay lethal.&lt;/p&gt;
&lt;p&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;https://github.com/usman19zafar/Project-A-Z-Cognitive-Pipeline-End-to-End-Autonomous-ML-Engineering-by-Gemini/tree/main&quot;&gt;https://github.com/usman19zafar/Project-A-Z-Cognitive-Pipeline-End-to-End-Autonomous-ML-Engineering-by-Gemini/tree/main&lt;/a&gt;&lt;/p&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/11604/humble-proof-of-machine-learning-deep-leaning-across-10-families-and-100-models</guid>
<pubDate>Fri, 13 Feb 2026 18:55:40 +0000</pubDate>
</item>
<item>
<title>Data Analysis -  Basic Visualizations</title>
<link>https://coderlegion.com/9377/data-analysis-basic-visualizations</link>
<description>&lt;p&gt;Building on the concepts from our post on &quot;Descriptive Statistics,&quot; we will now explore the most common charts for data visualization: &lt;a rel=&quot;nofollow&quot; href=&quot;https://datalaria.com/en/posts/descriptive-analysis/&quot;&gt;&quot;Descriptive Statistics&quot;&lt;/a&gt;, below, we will know the most basic ways to visualize the data or information to be analyzed. Specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#pie_chart&quot;&gt;Pie chart&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#line_chart&quot;&gt;Line chart&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#hierarchical_graphs&quot;&gt;Treemap &amp;amp; Subburst&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#histograms&quot;&gt;Histograms &amp;amp; Bar charts&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#density_plot&quot;&gt;Density plot&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#boxplot&quot;&gt;Boxplots&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#violin_plot&quot;&gt;Violin plots&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#scatter_plot&quot;&gt;Scatter plots&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a rel=&quot;nofollow&quot; href=&quot;#pareto_chart&quot;&gt;Pareto chart&lt;/a&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;em&gt;Note: All the examples (except for the line graphs due to its features) are based on the train.csv dataset file, which is a subset of 891 representative individuals of the population of the Titanic used for the training of models of Machine Learning.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;pie-charts&quot;&gt;&lt;a name=&quot;pie_chart&quot;&gt;&lt;/a&gt;Pie charts&lt;/h3&gt;
&lt;p&gt;Pie charts are useful to represent the numerical proportions of the values of the data of a variable or feature with respect to its total. This type of graphs present a vast catalogue of variants and are widely used due to their simplicity of preparation and interpretation. However, these charts are often overused and misused. For more on this topic, see this excellent article on why pie charts are so controversial &lt;a rel=&quot;nofollow&quot; href=&quot;https://medium.com/@clmentviguier/the-hate-of-pie-charts-harms-good-data-visualization-cc7cfed243b6&quot;&gt;about the right use of pie charts and why these charts are so hated&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Proportions of Titanic passengers by socioeconomic status&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/pie_chart.png&quot; alt=&quot;Pie_chart&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;line-charts&quot;&gt;&lt;a name=&quot;line_chart&quot;&gt;&lt;/a&gt;Line charts&lt;/h3&gt;
&lt;p&gt;Line charts are ideal for displaying how a variable changes over a continuous interval, such as time. Generally, they are used to represent trends or relationships (in a group with more variables) between the data during a continuous time interval.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Note: In order to visualize a use case in a continuous time interval, the following dataset from the Open data initiative of the Government of Spain has been used [the population data by Autonomous Communities from 1997 to 2017.](&lt;a rel=&quot;nofollow&quot; href=&quot;https://datos.gob.es/es/catalogo/ea0010587-poblacion-por-comunidades-y-ciudades-autonomas-y-tamano-de-los-municipios-anual-comunidades-&quot;&gt;https://datos.gob.es/es/catalogo/ea0010587-poblacion-por-comunidades-y-ciudades-autonomas-y-tamano-de-los-municipios-anual-comunidades-&lt;/a&gt; autonomas-official-figures-of-population-of-the-Spanish-municipalities-revision-of-padron-municipal-identifier-api-2915) *&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example: Spanish population since 1997&lt;br&gt;
&lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/line_graph_1.png&quot; alt=&quot;Line_graph_1&quot;&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example: Spanish population by Autonomous Communities since 1997&lt;br&gt;
 &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/line_graph_2.png&quot; alt=&quot;Line_graph_2&quot;&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&quot;treemaps-amp-sunbursts&quot;&gt;&lt;a name=&quot;hierarchical_graphs&quot;&gt;&lt;/a&gt;Treemaps &amp;amp; Sunbursts&lt;/h3&gt;
&lt;p&gt;Treemaps and sunburst graphs are visualizations to represent hierarchical data and summarize the information in areas proportional to the corresponding values.&lt;/p&gt;
&lt;p&gt;In the case of treemaps, the representation consists of rectangles with an area proportional to the value of the corresponding data with respect to the total.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Proportion of passengers according to their socioeconomic status classified by gender (treemap)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/treemap.png&quot; alt=&quot;Treemap&quot;&gt;&lt;/p&gt;
&lt;p&gt;In the case of sunburst, the representation consists groups of rings according to the level represented, which are divided into proportional sections corresponding to the value of the data they represent.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Proportion of passengers according to their socioeconomic status classified by gender (sunburst)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/sunburst.png&quot; alt=&quot;Sunburst&quot;&gt;&lt;/p&gt;
&lt;p&gt;On the example represented, you can quickly see information about the hierarchical data represented as for example that the number of male passengers was almost 2 / 3 of the crew, as well as that male passengers and low socioeconomic status represented something more than 1 / 3 of the crew.&lt;/p&gt;
&lt;h3 id=&quot;histograms-amp-bar-charts&quot;&gt;&lt;a name=&quot;histograms&quot;&gt;&lt;/a&gt;Histograms &amp;amp; Bar charts&lt;/h3&gt;
&lt;p&gt;Looking over the information already collected in the post &lt;a rel=&quot;nofollow&quot; href=&quot;https://datalaria.com/en/posts/descriptive-analysis/&quot;&gt;&quot;Descriptive Statistics&quot;&lt;/a&gt;, where these two type of representations widely used in data analysis are explained, we can check that their main objective is to represent the distribution of the data with respect to a variable or characteristic of the dataset. Thus, the histograms allow to visualize continuous data and the bar diagrams represent discrete data.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Passenger distribution by price of the ticket&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/histogram.png&quot; alt=&quot;Histogram&quot;&gt;&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Passenger distribution by socioeconomic status&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/bar_chart.png&quot; alt=&quot;Bar_chart&quot;&gt;&lt;/p&gt;
&lt;p&gt;As we saw in the post &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.datalaria.com/en/post/fundamentos/2018-10-07-estadistica-descriptiva/&quot;&gt;&quot;Descriptive Statistics&quot;&lt;/a&gt;, representing on these graphs measures of descriptive statistics (such as the mean or the median), we can characterize the distribution of the variable under analysis and thereby extract more information about it.&lt;/p&gt;
&lt;h3 id=&quot;density-plot&quot;&gt;&lt;a name=&quot;density_plot&quot;&gt;&lt;/a&gt;Density plot&lt;/h3&gt;
&lt;p&gt;As known as Kernel density plots, they serve to visualize the distribution of data in a continuous interval. This type of graphics is a variation of the histograms where the shape of the distribution is smoothly represented.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Distribution of the age of Titanic passengers  &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/density_plot.png&quot; alt=&quot;Density_plot&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;boxplots&quot;&gt;&lt;a name=&quot;boxplot&quot;&gt;&lt;/a&gt;Boxplots&lt;/h3&gt;
&lt;p&gt;The boxplots or whisker plots serve to represent a variable or characteristic depending on its range and its quartiles.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: The quartiles are the values that divide a list of ordered numbers into 4 parts in equal percentages&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;The boxplot consists of a box that includes the data from the first quartile (Q1 - 25% of the data under it) to the third quartile (Q3 - 75% of the data under it) of the values of the variable represented (Interquartile Range - IQR). Within said box, the median is represented with an horizontal line and optionally, the average is represented by an asterisk or a star.&lt;/p&gt;
&lt;p&gt;In addition to the box, this plot also shows 2 horizontal lines (or &quot;fences&quot;) that represent the maximum and minimum typical values of our variable, and from which the outliers of the distribution are visualized using points.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Statistical note: The outliers are those that are numerically distant from the rest of the data of the variable. Taking the Interquartile Range (IQR), outliers are considered those that are below Q1 - 1.5 IQR or above Q3 + 1.5 IQR.&lt;/em&gt;&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Distribution of Titanic passengers by age&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/boxplot.png&quot; alt=&quot;Boxplot&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;violin-plots&quot;&gt;&lt;a name=&quot;violin_plot&quot;&gt;&lt;/a&gt;Violin plots&lt;/h3&gt;
&lt;p&gt;Violin plots are used to visualize simultaneously the distribution of the data and its probability density. These visual graphs consist of a combination of a boxplot and a density plot. In this plot, the Intercuartile range is represented by a thick black line or small box, the typical data are represented with a thin black line and the median is visualized with a white point.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Distribution and density of Titanic passengers by age&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/violin_plot.png&quot; alt=&quot;Violin_plot&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;scatter-plots&quot;&gt;&lt;a name=&quot;scatter_plot&quot;&gt;&lt;/a&gt;Scatter plots&lt;/h3&gt;
&lt;p&gt;Scatter plots consist of visualizations that show the relationship of 2 variables of a dataset on two Cartesian axes. They are quite useful since they allow extracting information about the correlation between these variables.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Representation of ticket price by age and gender of the passenger&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/scatter_plot.png&quot; alt=&quot;Scatter_plot&quot;&gt;&lt;/p&gt;
&lt;h3 id=&quot;pareto-charts&quot;&gt;&lt;a name=&quot;pareto_chart&quot;&gt;&lt;/a&gt;Pareto charts&lt;/h3&gt;
&lt;p&gt;The Pareto charts serve to visually represent those distributions or datasets related to the Pareto principle or the 80 / 20 rule.&lt;br&gt;
Pareto principle: also known as the 80 / 20 rule, establishes that generally in a dataset related by a cause-effect relationship, approximately 80% of the results or consequences come from 20% of the causes.&lt;br&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Representation of income data for tickets sold for the socioeconomic status&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/pareto_chart_1.png&quot; alt=&quot;Pareto_chart&quot;&gt;  &lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Representation of income data for tickets sold for passengers&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/basic-visualizations/pareto_chart_2.png&quot; alt=&quot;Pareto_chart_2&quot;&gt;&lt;/p&gt;
&lt;p&gt;Regarding the example, we can see the usefulness of this graph given that it is quickly visualized that 90% of the ticket sales revenues of the Titanic come from tickets sold to passengers of high socioeconomic status. Or in a more detailed way about the second graph, approximately 80% of the revenue from ticket sales came from ~ 20% of the crew's passengers.&lt;br&gt;
&lt;/p&gt;
&lt;h5 id=&quot;sources-of-interest-&quot;&gt;Sources of interest:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Kaggle – &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kaggle.com/c/titanic&quot;&gt;Titanic Machine Learning from Disaster&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Open data initiative of the Government of Spain – &lt;a rel=&quot;nofollow&quot; href=&quot;https://datos.gob.es/en&quot;&gt;datos.gob.es&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Medium (Clément Viguier) – &lt;a rel=&quot;nofollow&quot; href=&quot;https://medium.com/@clmentviguier/the-hate-of-pie-charts-harms-good-data-visualization-cc7cfed243b6&quot;&gt;The hate of pie charts harms good data visualization...&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Course &lt;em&gt;“&lt;a rel=&quot;nofollow&quot; href=&quot;https://courses.edx.org/courses/course-v1:Microsoft+DAT222x+1T2017/course/&quot;&gt;Essential Statistics for Data Analysis using Excel&lt;/a&gt;”&lt;/em&gt; perteneciente al Microsoft Data Science Program&lt;/li&gt;
&lt;li&gt;The Data Visualisation Catalogue - &lt;a rel=&quot;nofollow&quot; href=&quot;https://datavizcatalogue.com/index.html&quot;&gt;The Data Visualisation Catalogue&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/9377/data-analysis-basic-visualizations</guid>
<pubDate>Wed, 07 Jan 2026 20:55:59 +0000</pubDate>
</item>
<item>
<title>Descriptive Analysis - Basics</title>
<link>https://coderlegion.com/9325/descriptive-analysis-basics</link>
<description>&lt;p&gt;As a starting point in data analysis, it is necessary to know some mathematical and statistical foundations in order to work with the information to be analyzed.&lt;/p&gt;
&lt;p&gt;Thus, we will start learning some basic concepts:&lt;/p&gt;
&lt;h3 id=&quot;population-samples-individuals-and-variables-&quot;&gt;Population, Samples, Individuals and Variables:&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Population&lt;/strong&gt;: The set of all the elements under study&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Sample&lt;/strong&gt;: A subset of elements of the population (it should be  representative of the population)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Individuals&lt;/strong&gt;: Every individual element in the popularion&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Variables&lt;/strong&gt;: Characteristics of the individuals&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/population_sample_individuals_variables.png&quot; alt=&quot;Population_Sample_Individuals_Variables&quot;&gt;&lt;/p&gt;
&lt;p&gt;Example: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kaggle.com/c/titanic/data&quot;&gt;Titanic Dataset&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Population: 2.224 individuals&lt;/li&gt;
&lt;li&gt;Samples: files:&lt;ul&gt;
&lt;li&gt;&lt;em&gt;train.csv&lt;/em&gt;: Set of 891 representative individuals of the population used for the training of models of Machine Learning.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;test.csv&lt;/em&gt;: Set of 418 representative individuals of the population used for the testing of models of Machine Learning.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Individuals: Each passenger and crew of the population (every row of the sample or population data collected).&lt;/li&gt;
&lt;li&gt;Variables: The characteristics collected for each individual (every column of the sample or population data, ej.: &lt;em&gt;survival&lt;/em&gt; (survivals), &lt;em&gt;sex&lt;/em&gt; (sex) o &lt;em&gt;Age&lt;/em&gt; (age)).&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;types-of-variables&quot;&gt;Types of Variables&lt;/h4&gt;
&lt;p&gt;The variables can be classified depending on the type of data they contain and, more specifically:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Numerical&lt;/strong&gt;: the data is represented by numbers that are metric or measures of said variable. According to their values, these could be classified in:&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Continuous&lt;/strong&gt;: they could take a countless or indeterminate number of values. For example, in the data set of the Titanic example, the variable &lt;em&gt;fare&lt;/em&gt; could be considered a continuous variable by taking different values with up to 4 decimals of precision.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discretes&lt;/strong&gt;: they could take a countable number within a list of values (the data of continuous variables can be truncated to discrete variables for easier analysis). For example, the variable &lt;em&gt;Sibsp&lt;/em&gt; (# of siblings) would be a discrete variable.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Categorical&lt;/strong&gt;: the data is represented by texts or numbers whose meaning is not a metric, but associated with a specific datum or category. Depending on the relationship between their values, the data would be classified in:&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Nominals&lt;/strong&gt;: data that have no relation or intrinsic order in themselves. An example of this type would be the &lt;em&gt;embarked&lt;/em&gt; variable that represents the port of embarkation of passengers.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Discretes&lt;/strong&gt;: data with a natural order or classification among themselves. As for example it could be the variable &lt;em&gt;Pclass&lt;/em&gt; that represents the class in the Titanic according to the social status.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Note of interest:&lt;/em&gt;&lt;/strong&gt; &lt;em&gt;The typology of the variables is not always clear and they could be considered of different types depending on the criteria of each person and the objectives sought. An example could be the representation of age, which could be correctly considered both numerical (continuous or discrete depending on the precision) and ordinal, depending on whether you want to work with formulas to treat age as a continuous value or simply work with specific age ranges according to the relationship of the rest of the variables.&lt;/em&gt;&lt;/p&gt;
&lt;h3 id=&quot;histograms-and-bar-charts&quot;&gt;Histograms and Bar charts&lt;/h3&gt;
&lt;p&gt;Although I will make a specific post for the data visualization, it is important to briefly mention the histograms and bar graphs. These are two of the most useful representations in the data analysis and help to understand how the data are distributed with respect to a variable or characteristic of the dataset (continuous in the case of histograms and discrete in the case of bar graphs).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Bar chart&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/bar_chart.png&quot; alt=&quot;Bar charts&quot;&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example: Histogram&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/histogram.png&quot; alt=&quot;Histogram&quot;&gt;&lt;/p&gt;
&lt;p&gt;Thus, significant information about the data distribution can be extracted, classifying it in symmetric or asymmetric, as we will see below.&lt;/p&gt;
&lt;h3 id=&quot;measures-of-descriptive-statistics&quot;&gt;Measures of descriptive statistics&lt;/h3&gt;
&lt;p&gt;A key step when analyzing a dataset is what is called &quot;descriptive statistics&quot;, that is, in describing the data through a series of measures that allow to characterize its distribution and its dispersion.&lt;/p&gt;
&lt;h4 id=&quot;measures-of-central-tendency&quot;&gt;Measures of central tendency&lt;/h4&gt;
&lt;p&gt;The measures of central tendency serve to give us an idea of the distribution of our data.&lt;/p&gt;
&lt;h5 id=&quot;arithmetic-mean-average-&quot;&gt;Arithmetic Mean (Average)&lt;/h5&gt;
&lt;p&gt;This measure seeks to obtain the average value of a dataset. That is, all the values in the dataset are summed and divided by the total number of values in that data.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Population mean&lt;/strong&gt;:&lt;br&gt;
\[\mu = \frac{1}{N}\displaystyle\sum_{i=1}^Nx_i\]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Sample mean&lt;/strong&gt;:&lt;br&gt;
\[\bar x = \frac{1}{n}\displaystyle\sum_{i=1}^Nx_i\]&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Being &lt;em&gt;N&lt;/em&gt; the total of values in the population and &lt;em&gt;n&lt;/em&gt; the total of values in the sample.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
If we have the following set of 5 data: [1, 2, 2, 5, 10], the average or mean of these values is their sum (20) divided by the total of data (5), that is, the average or mean is 4.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following up on our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its average or mean:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/average.png&quot; alt=&quot;Average&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;median&quot;&gt;Median&lt;/h5&gt;
&lt;p&gt;This measure represents the middle value in the dataset. That is, for its calculation, we take the data point in the middle of all the dataset x&lt;sub&gt;m&lt;/sub&gt;:&lt;/p&gt;
&lt;p&gt;\[\displaystyle x_{m} = x (\frac{n+1}{2})\]&lt;/p&gt;
&lt;p&gt;The median, due to its dependence on the position of the values and not on their values, is less dependent on extreme values (outliers) than the arithmetic mean. That is why in many common statistics (for example, the average salary of the population) it would be more convenient to use the median instead of the average to avoid the presence of very high values that could misalign or mislead the analysis.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
If we have the following set of 5 data: [1, 2, 2, 5, 10], the median of these values is the data n the middle of the dataset. That is, the value in the third position, the number 2.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following up on our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its median:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/median.png&quot; alt=&quot;Mediana&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;mode&quot;&gt;Mode&lt;/h5&gt;
&lt;p&gt;The mode in statistics represents the most frequently accruing value in the dataset.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the mode is the most repeated value, that is 2.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset, and taking the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt;, we visualize its distribution and its mode:&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/mode.png&quot; alt=&quot;Moda&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;analysis-of-central-tendency&quot;&gt;Analysis of central tendency&lt;/h4&gt;
&lt;p&gt;As the examples show, first conclusions can be drawn regarding the distribution of the analyzed variable and its most representative values. Therefore, and comparing these values, we can characterize the distribution of a variable to be symmetric (those cases where the mean, median and mode are similar), or to be positive asymmetric (more values are below the mean and in that case the mean is greater than the median and this greater than the mode) or negative asymmetric (more values are above the mean and the mean is lower than the median and this lower than the mode).&lt;/p&gt;
&lt;p&gt;As we have seen in our example of the Titanic and the Age of its passengers we have a certain positive asymmetry (Mean = 29.69 &amp;gt; Median = 28 &amp;gt; Mode = 24) which indicates that there were more people below 29.69 years that above.&lt;/p&gt;
&lt;h4 id=&quot;meaures-of-variability&quot;&gt;Meaures of variability&lt;/h4&gt;
&lt;p&gt;The measures of variability serve to give us an idea about how spread apart the data values are.&lt;/p&gt;
&lt;h5 id=&quot;range&quot;&gt;Range&lt;/h5&gt;
&lt;p&gt;The range is simply a way to express full distribution of the data and it's calculated substracting the minimum value in a set from the maximum one.&lt;/p&gt;
&lt;p&gt;\[\displaystyle Range  = Max (i) - Min (i)\]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Analyzing our dataset of 5 values: [1, 2, 2, 5, 10], the range is 10 - 1 = 9.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset, the range in the &lt;em&gt;Age&lt;/em&gt; variable is 80-0,42 = 79,58 years.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;variance&quot;&gt;Variance&lt;/h5&gt;
&lt;p&gt;The variance is a measure of the dispersion of the values with respect to its average or mean value. It is calculated by obtaining the average value of the square of its residuals (differences of each value with respect to the average). That is:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Variance of the population&lt;/strong&gt;:&lt;br&gt;
\[\sigma^{2} = \frac{\displaystyle\sum_{i=1}^N (x_i-\mu)^2}{N}\]&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Unbiased variance of the sample&lt;/strong&gt;:&lt;br&gt;
\[s^{2} = \frac{\displaystyle\sum_{i=1}^N (x_i-\bar x)^2}{n - 1} \]&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The calculation is made on the square of the differences because if we add all their differences the result would be 0.&lt;/p&gt;
&lt;p&gt;Regarding the difference in the denominator of both calculations, this is because we are using what is known as unbiased variance of the sample. This modification is based on the fact that we are calculating a statistical value of a sample that could be leaving the population mean outside or far from our values, if we calculate the variance of the sample dividing by n, we could be underestimating the real value of the population variance (more information can be found at Kahn Academy: &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.youtube.com/watch?v=KkaU2ur3Ymw&quot;&gt;Explanation about why we divide by n-1 for the unbiased variance of the sample&lt;/a&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the variance of the population is 10,8.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our unbiased variance is 211,01.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;standard-deviation&quot;&gt;Standard deviation&lt;/h5&gt;
&lt;p&gt;The standard deviation is a measure of the dispersion of the values of the analyzed variable represented in their same units. Its calculation is made by &lt;strong&gt;the square root of the variance&lt;/strong&gt; and its representation is simply &lt;em&gt;sigma&lt;/em&gt; or &lt;em&gt;s&lt;/em&gt; depending on whether it represents the population or the sample.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Example:&lt;br&gt;
Continuing with our set of 5 data: [1, 2, 2, 5, 10], the standard deviation is 3,67.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our, the standard deviation of the sample is 14,52 years.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h5 id=&quot;standard-error&quot;&gt;Standard error&lt;/h5&gt;
&lt;p&gt;The standard error serves to measure how well a sample represents the population. The calculation is made by dividing the standard deviation by the square root of the total values of the sample.&lt;/p&gt;
&lt;p&gt;\[\displaystyle SE_{\bar x} = \frac{s} {\sqrt n}\]&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Example of the Titanic dataset:&lt;br&gt;
Following with our example of the Titanic dataset and the &lt;em&gt;Age&lt;/em&gt; variable in the sample &lt;em&gt;train.csv&lt;/em&gt; our, the standard error of the sample is 0,54.&lt;/li&gt;
&lt;/ul&gt;
&lt;h4 id=&quot;analysis-of-the-variability&quot;&gt;Analysis of the variability&lt;/h4&gt;
&lt;p&gt;As seen from the examples seen, these measures help to draw first conclusions regarding the dispersion or variability of our distribution values. This is useful when comparing datasets on variables with those we have worked with previously.&lt;/p&gt;
&lt;p&gt;In addition, and in combination with the measures of central tendency, these measures are of special interest in order to extract information about the distribution of the data of our variable, and in this way, characterize said variable in one way or another.&lt;/p&gt;
&lt;h3 id=&quot;basic-distributions&quot;&gt;Basic distributions&lt;/h3&gt;
&lt;p&gt;As final subject in this first article of the &lt;em&gt;Fundamentals&lt;/em&gt; series, it is interesting to visualize the distributions of the data because they can give more clear information than the one extracted from their calculated values. According to the data treated, the most typical distributions that we can find could be:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Based on the asymmetry coefficient (according to the measures of the central tendency), and as mentioned above, we could distinguish:&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;symmetric-distribution-&quot;&gt;Symmetric distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The values of the mean, median and mode are similar&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;  &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/symmetric.png&quot; alt=&quot;Symmetric&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;asymmetric-distribution-&quot;&gt;Asymmetric distribution:&lt;/h4&gt;
&lt;h5 id=&quot;positive-asymmetry-&quot;&gt;Positive asymmetry:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;More values are concentrated below the average or mean. Being this greater than the median and this greater than fashion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/positive_asymmetry.png&quot; alt=&quot;Positive_asymmetry&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;negative-asymmetry-&quot;&gt;Negative asymmetry:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;More values are concentrated above the average or mean. Being this smaller than the median and this smaller than fashion.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/negative_asymmetry.png&quot; alt=&quot;Negative_asymmetry&quot;&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;According to the shape of the distribution, the most typical cases of representation would be:&lt;/li&gt;
&lt;/ol&gt;
&lt;h4 id=&quot;uniform-distribution-&quot;&gt;Uniform distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Almost all values are identical throughout the range of the variable. This type of distributions could be due to the fact that the representation intervals are too small or too large, and because the variables represented consist of a combination of several variables. Therefore, it is advisable to vary the way of representing the data to detect changes that induce more information:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/uniform.png&quot; alt=&quot;Uniform&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;random-distribution-&quot;&gt;Random distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Those distributions without a clear pattern of representation where different modes or peaks can be distinguished. These could be due to the same cases as those indicated for the normal distribution, so it is recommended to try to make changes in their representation:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/random.png&quot; alt=&quot;Random&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;bimodal-distribution-&quot;&gt;Bimodal distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;Distributions with 2 modes or peaks, which generally indicates that they are affected by 2 sources of variation that should try to be studied independently. It could be the case that the measures of  central tendency and variability are similar, so their visualization is convenient for a better understanding.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/bimodal_distribution.png&quot; alt=&quot;Bimodal&quot;&gt;&lt;/p&gt;
&lt;h4 id=&quot;normal-distribution-&quot;&gt;Normal distribution:&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;The normal or Gaussian distribution consists of the desired distribution for all our data. Although it will have a specific post for analyzing its characteristics, briefly explained, it is a symmetrical bell-shaped function that allows us to model numerous phenomena of nature. The great advantage of having variables whose data are assimilated to this type of distribution is that their distribution can be characterized according to their standard deviation in the following way:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt; &lt;img src=&quot;https://datalaria.com/en/posts/descriptive-analysis/normal_distribution.png&quot; alt=&quot;Normal&quot;&gt;&lt;/p&gt;
&lt;h5 id=&quot;sources-of-interest--1&quot;&gt;Sources of interest:&lt;/h5&gt;
&lt;ul&gt;
&lt;li&gt;Kaggle – &lt;a rel=&quot;nofollow&quot; href=&quot;https://www.kaggle.com/c/titanic&quot;&gt;Titanic Machine Learning from Disaster&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
<category>Articles</category>
<guid isPermaLink="true">https://coderlegion.com/9325/descriptive-analysis-basics</guid>
<pubDate>Wed, 07 Jan 2026 00:19:35 +0000</pubDate>
</item>
</channel>
</rss>