<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://skytales.nl/feed.xml" rel="self" type="application/atom+xml" /><link href="https://skytales.nl/" rel="alternate" type="text/html" /><updated>2026-10-28T10:31:25+00:00</updated><id>https://skytales.nl/feed.xml</id><title type="html">Jasper Taal | Visualizations &amp;amp; Code</title><subtitle>A minimal portfolio to showcase creative coding projects and blog about the process.</subtitle><author><name>Jasper Taal</name></author><entry><title type="html">The Vectorgram: Stochastic Paths Through Life’s Structured Embedding</title><link href="https://skytales.nl/2025/11/17/vectorgram.html" rel="alternate" type="text/html" title="The Vectorgram: Stochastic Paths Through Life’s Structured Embedding" /><published>2025-11-17T00:00:00+00:00</published><updated>2025-11-17T00:00:00+00:00</updated><id>https://skytales.nl/2025/11/17/vectorgram</id><content type="html" xml:base="https://skytales.nl/2025/11/17/vectorgram.html"><![CDATA[<h2 id="introduction">Introduction</h2>

<p>When I imagined complex, imaginary waveforms from a virtual frame of reference that has never shifted since the moment I existed, I stumbled upon a stochastic walk in the park of our generic embedding space. There, the vectorgram revealed itself — a Markov-chain, max-entropy random walk threading through the architecture of existence itself.</p>

<p>[Image of abstract glowing vector lines forming a double helix structure in a dark void]</p>

<p>Yet life is not purely random. Our protein and nucleotide sequences are not uniform; they carry directionality, biases, and constraints imposed by evolution, chemistry, and function. The embedding space is structured: some paths are highly favored, others forbidden, yet the framework of entropy and stochasticity governs the landscape.</p>

<hr />

<h2 id="markov-chain-transitions-for-sequences">Markov Chain Transitions for Sequences</h2>

<p>A sequence $X$ can be modeled as a Markov chain, where the probability of the next element depends only on the current state:</p>

\[P(X_{t+1} = x_{t+1} \mid X_t = x_t) = p_{x_t x_{t+1}}, \quad \sum_{x_{t+1}} p_{x_t x_{t+1}} = 1\]

<p>For longer dependencies, an order-$k$ Markov chain captures motifs and directional patterns:</p>

\[P(X_{t+1} \mid X_t, X_{t-1}, ..., X_{t-k+1}) = p_{x_{t-k+1} \dots x_t, x_{t+1}}\]

<p>In biological sequences, $P$ is far from uniform. Codon bias, amino acid preferences, and motif constraints create directionality:</p>

\[p_{ij} \neq p_{ji}, \quad \sum_j p_{ij} = 1\]

<h3 id="the-methylation-constraint-a-broken-symmetry">The Methylation Constraint: A Broken Symmetry</h3>
<p>In a generic uniform space, all transitions in a nucleotide sequence would be $0.25$. However, biological embedding spaces are warped by chemical constraints, such as <strong>CpG methylation</strong>.</p>

<p>In vertebrate genomes, the transition from Cytosine (C) to Guanine (G) is suppressed because methylated Cytosines tend to spontaneously deaminate into Thymine. This creates a distinct “forbidden path” in the vectorgram, breaking the symmetry of the matrix $M$:</p>

\[M_{\text{DNA}} = \begin{bmatrix} 
p_{AA} &amp; p_{AC} &amp; p_{AG} &amp; p_{AT} \\
p_{CA} &amp; p_{CC} &amp; \mathbf{p_{CG}} &amp; p_{CT} \\
p_{GA} &amp; p_{GC} &amp; p_{GG} &amp; p_{GT} \\
p_{TA} &amp; p_{TC} &amp; p_{TG} &amp; p_{TT} 
\end{bmatrix} 
\approx
\begin{bmatrix} 
0.30 &amp; 0.20 &amp; 0.20 &amp; 0.30 \\
0.25 &amp; 0.25 &amp; \mathbf{0.05} &amp; 0.45 \\
0.30 &amp; 0.20 &amp; 0.30 &amp; 0.20 \\
0.20 &amp; 0.30 &amp; 0.30 &amp; 0.20 
\end{bmatrix}\]

<p>The suppression of $p_{CG}$ ($\approx 0.05$) represents a physical chemical constraint manifesting as a statistical anomaly in the random walk.</p>

<hr />

<h2 id="entropy-and-conditional-measures">Entropy and Conditional Measures</h2>

<p>Shannon entropy quantifies uncertainty in the sequence:</p>

\[H(X) = - \sum_i p_i \log p_i\]

<p>Joint entropy captures uncertainty over multiple positions:</p>

\[H(X, Y) = - \sum_{i,j} p_{ij} \log p_{ij}\]

<p>Conditional entropy expresses the remaining uncertainty given a previous residue:</p>

\[H(Y \mid X) = H(X, Y) - H(X) = - \sum_{i,j} p_{ij} \log \frac{p_{ij}}{p_i}\]

<p>In biological sequences, reflecting directional constraints and non-random structure.</p>

<hr />

<h2 id="kl-divergence-measuring-deviation-from-randomness">KL Divergence: Measuring Deviation from Randomness</h2>

<p>To quantify how biological sequences deviate from maximum-entropy or uniform expectations, we use KL divergence:</p>

\[D_{\text{KL}}(Q \parallel P) = \sum_i Q(i) \log \frac{Q(i)}{P(i)}\]

<ul>
  <li>$Q(i)$ = observed frequency of residues</li>
  <li>$P(i)$ = reference (uniform or max-entropy) distribution</li>
  <li>$D_{\text{KL}}$ reveals the bias and directionality of life itself</li>
</ul>

<hr />

<h2 id="max-entropy-random-walks">Max-Entropy Random Walks</h2>

<p>The maximum entropy random walk traverses the embedding space while respecting constraints:</p>

\[p_{ij} = \frac{A_{ij}}{\sum_k A_{ik}}, \quad \pi P = \pi\]

<ul>
  <li>$A$ = adjacency matrix of allowed transitions</li>
  <li>$\pi$ = stationary distribution</li>
</ul>

<p>The walk maximizes uncertainty locally while following structural constraints.</p>

<p>For biological sequences, this produces a stochastic yet directed exploration, where each residue, motif, and protein is a step through a constrained probabilistic landscape.</p>

<p>[Image of a complex mathematical matrix overlaying a protein folding diagram]</p>

<hr />

<h2 id="the-vectorgram-threads-of-life">The Vectorgram: Threads of Life</h2>

<p>The vectorgram is the map of this structured stochasticity:</p>

<ul>
  <li><strong>Steps</strong> = residues in sequences</li>
  <li><strong>Transitions</strong> = Markov probabilities shaped by function and evolution</li>
  <li><strong>Entropy</strong> = uncertainty at each step</li>
  <li><strong>KL divergence</strong> = divergence from uniform randomness</li>
</ul>

<p>It captures the interplay of chance and necessity, the dance between probabilistic exploration and directional constraint. Every protein, every nucleotide, every motif is a thread woven into the tapestry of existence.</p>

<hr />

<h2 id="conclusion">Conclusion</h2>

<p>This is all it is: a Markov chain, a stochastic walk, and entropy constrained by life’s inherent structure. And this post is my record — a trace of independent exploration, an attempt to glimpse the patterns underlying our very existence.</p>]]></content><author><name>Jasper Taal</name></author><summary type="html"><![CDATA[A map of the structured stochasticity, Markov chains, and entropy that thread through the architecture of existence.]]></summary></entry><entry><title type="html">Visualizing Regularisation in 3D with Ridge and Lasso</title><link href="https://skytales.nl/2025/09/14/regularisation.html" rel="alternate" type="text/html" title="Visualizing Regularisation in 3D with Ridge and Lasso" /><published>2025-09-14T00:00:00+00:00</published><updated>2025-09-14T00:00:00+00:00</updated><id>https://skytales.nl/2025/09/14/regularisation</id><content type="html" xml:base="https://skytales.nl/2025/09/14/regularisation.html"><![CDATA[<h2 id="introduction">Introduction</h2>
<p>Regularisation is one of the most powerful techniques in machine learning to combat <strong>overfitting</strong> and improve <strong>generalization</strong>.<br />
Instead of keeping it abstract, this post introduces an <strong>interactive 3D Regularisation Visualizer</strong>.</p>

<hr />

<h2 id="what-is-regularisation">What is Regularisation?</h2>

<p>When fitting a model, we usually solve the least sum of squares (OLS):</p>

\[\hat{\beta} = \arg \min_{\beta} \ \|y - X\beta\|_2^2\]

<p>The issue? With too many features or high-degree polynomials and too few samples, the model can <strong>overfit</strong> noise due to supercollinearity and under representation.</p>

<p>Regularisation adds a penalty:</p>

<ul>
  <li>
    <p><strong>Ridge (L2):</strong><br />
\(\hat{\beta} = \arg \min_{\beta} \ \|y - X\beta\|_2^2 + \lambda \|\beta\|_2^2\)</p>
  </li>
  <li>
    <p><strong>Lasso (L1):</strong><br />
\(\hat{\beta} = \arg \min_{\beta} \ \|y - X\beta\|_2^2 + \lambda \|\beta\|_1\)</p>
  </li>
</ul>

<p>Here, ( \lambda ) controls the penalty strength.</p>

<hr />

<h2 id="the-interactive-demo">The Interactive Demo</h2>

<p>The visualizer lets you:</p>

<ul>
  <li>Adjust the <strong>polynomial degree</strong> of the model</li>
  <li>Switch between <strong>Ridge, Lasso, and OLS (no penalty)</strong></li>
  <li>Control <strong>λ (penalty strength)</strong> dynamically</li>
  <li>Add <strong>Gaussian-distributed data</strong> with custom mean, variance, and correlation</li>
  <li>Display <strong>covariance matrices, determinants, and bias terms</strong></li>
  <li>Toggle <strong>2D/3D views, mesh styles, and penalty constraints</strong></li>
</ul>

<p>functionally:</p>
<ul>
  <li><strong>Data Distributions:</strong> Multiple Gaussians show how variance and correlation shape covariance.</li>
  <li><strong>Penalty Geometry:</strong>
    <ul>
      <li>L1 → Octahedron (diamond constraint)</li>
      <li>L2 → Sphere (circular constraint)</li>
    </ul>
  </li>
  <li><strong>Hit Point:</strong> Highlights where the regression solution collides with the penalty boundary.</li>
  <li><strong>Metrics Panel:</strong> Displays bias, covariance, and determinant in real time.</li>
</ul>

<hr />

<h2 id="2d-formulas">2D Formulas</h2>

<ul>
  <li><strong>Covariance Matrix:</strong></li>
</ul>

\[\Sigma = 
\begin{bmatrix}
\sigma_x^2 &amp; \rho \sigma_x \sigma_y \\
\rho \sigma_x \sigma_y &amp; \sigma_y^2
\end{bmatrix}\]

<ul>
  <li><strong>Determinant:</strong></li>
</ul>

\[|\Sigma| = \sigma_x^2 \sigma_y^2 - (\rho \sigma_x \sigma_y)^2\]

<ul>
  <li><strong>Ridge Normal Equation:</strong></li>
</ul>

\[\hat{\beta} = (X^T X + \lambda I)^{-1} X^T y\]

<h2 id="conclusion">Conclusion</h2>

<p>The <strong>Regularisation Visualizer</strong> bridges math and intuition. It shows how Ridge and Lasso reshape solution spaces, revealing the trade-offs between <strong>bias, variance, and sparsity</strong>.<br />
Whether for teaching, experimenting, or exploring, it’s a powerful way to make abstract equations <strong>come alive in 3D</strong>.</p>]]></content><author><name>Jasper Taal</name></author><summary type="html"><![CDATA[Explanation of fundamental regularisation techniques.]]></summary></entry><entry><title type="html">Explaining the 4D Complex Chirp Visualization</title><link href="https://skytales.nl/2025/08/27/complex-chirp-explained.html" rel="alternate" type="text/html" title="Explaining the 4D Complex Chirp Visualization" /><published>2025-08-27T00:00:00+00:00</published><updated>2025-08-27T00:00:00+00:00</updated><id>https://skytales.nl/2025/08/27/complex-chirp-explained</id><content type="html" xml:base="https://skytales.nl/2025/08/27/complex-chirp-explained.html"><![CDATA[<p>The visualization you see is an attempt to represent a four-dimensional concept in a 3D space. The signal is a complex exponential:</p>

\[s(t) = e^{j\theta(t)} = \cos(\theta(t)) + j\sin(\theta(t))\]

<p>Here, the phase <code class="language-plaintext highlighter-rouge">θ(t)</code> is not linear. Its derivative, the instantaneous frequency, increases over time. This is called a “chirp” signal.</p>

<h3 id="the-axes">The Axes</h3>

<ul>
  <li><strong>Real Axis (X):</strong> Represents the real part, <code class="language-plaintext highlighter-rouge">cos(θ(t))</code>.</li>
  <li><strong>Imaginary Axis (Y):</strong> Represents the imaginary part, <code class="language-plaintext highlighter-rouge">sin(θ(t))</code>.</li>
  <li><strong>Frequency Axis (Z):</strong> This axis is used to represent the passage of time, during which the frequency increases, causing the spiral to tighten.</li>
</ul>

<p>This creates the distinctive “chirping” spiral you see.</p>]]></content><author><name>Jasper Taal</name></author><summary type="html"><![CDATA[An interactive visualization that represents a four-dimensional concept in a 3D space.]]></summary></entry></feed>