
Model purchase links with NGCF and LightGCN. Follow graph normalization and training, evaluate recommendations, and compare accuracy with runtime.
This section covers the theory and Python implementation behind a wide range of math and algorithm topics, including recommender systems, graph theory, linear algebra, quantum computing, and marketing statistics models.
[2020-05-30] : Moved the blog posts to this site.
[2026-05-01] : Removed several outdated articles.
[2026-11-01] : Decided to rewrite and republish the removed articles.
Articles are grouped by their last update year, newest first.

Model purchase links with NGCF and LightGCN. Follow graph normalization and training, evaluate recommendations, and compare accuracy with runtime.

Build ALS and BPR recommendations from purchase histories. Evaluate top-five rankings and examine data splits, candidate filtering, and diversity.

Estimate future purchase days and gross profit with BG/NBD and gamma-gamma models, validate forecasts, and calculate 12-month customer lifetime value.

Decompose sales with Prophet and state-space models. Check forecasts, latent trends, prediction errors, and interval coverage on held-out data.

Find products bought together with Apriori and Eclat. Calculate support, confidence, and lift, then assess rules before testing a recommendation.

Study churn with survival analysis and LightGBM, choose target customers, and estimate retention gains and profit in a hypothetical A/B test.

Use hierarchical Bayes and PyMC to estimate individual price responses. Check shrinkage, MCMC diagnostics, posterior predictions, and uncertainty.

Model purchase counts with the NBD and brand choice with a Dirichlet distribution. Compare penetration, purchase frequency, and model fit in Python.

Estimate a multinomial logit model, interpret odds ratios and willingness to pay, and compare a price cut with longer battery life in Python.

Derive the Bass model, estimate monthly adoption and market size, and check forecast errors, uncertainty, and changes as more sales data arrive.

Group customers with k-means and GMM, compare purchase patterns and membership probabilities, and use the results to plan and test marketing actions.

Derive conjugate gradients by minimizing a quadratic. Check conjugacy, residuals, convergence, and sparse systems against SciPy in Python.

Compare explicit inversion with direct solves in cost, accuracy, and storage. Check Hilbert matrices, reuse LU factors, and examine sparse systems.

Relate forward and backward errors to residuals and condition numbers. Use cancellation and pivoting examples to separate sensitivity from stability.

Implement a Bogacki–Shampine 3(2) solver with adaptive steps. Compare local and global errors, tolerances, cost, and SciPy’s RK23 and RK45.

Match RK4 stages to the exact Taylor expansion and derive local and global error orders. Check linear, nonlinear, and coupled equations in Python.

Derive midpoint, Heun, and RK4 methods by matching Taylor terms. Compare error, function evaluations, and stability with Euler’s method in Python.

Derive Gauss–Newton and Levenberg–Marquardt updates, then compare damping, rejected steps, starting points, and curve fitting in Python.

Derive BFGS from gradient differences and the secant condition. Compare convergence, Hessian approximation error, and line searches in Python.

Connect Galerkin’s method to finite elements through local basis functions, matrix assembly, and Python checks of solution and derivative errors.

Derive the weak form of Poisson’s equation, assemble linear finite elements, and check boundary conditions, solution errors, and convergence in Python.

Describe heat transfer along graph edges using a Laplacian and matrix exponential. Derive a heat-kernel solution for three vertices and use Python to check heat conservation, convergence to the mean, and eigenvalue-dependent decay. Vary the weight of an edge joining two groups and compare spectral gaps with diffusion rates.

Explain graph diffusion as a weighted sum of random walks of different lengths. Derive Personalized PageRank (PPR) from walks with restarts and compare a three-vertex hand calculation with a sparse Python implementation. Examine restart probabilities and starting distributions, then compare diffusion weighted by geometric and Poisson distributions.

Derive the Rayleigh quotient as a weighted average of eigenvalues and find its maximum and minimum. Explain why maximizing projected variance in PCA and minimizing ground-state energy in quantum mechanics share the same form. Use Python with two-dimensional data and a two-level system to plot how direction and relative phase change the quotient.

Derive statistical and machine-learning calculations from the common exponential-family form. Use Bernoulli, Poisson, and normal distributions to connect log-partition derivatives, sufficient statistics, and maximum likelihood. Compute beta-prior updates and logistic regression in Python, and distinguish convexity of the loss from the existence of a finite estimate.

Derive the Poisson equation in semiconductor electrostatics, heat transfer, fluids, and gravity using gradients and divergence. Compare source signs and boundary conditions for electric potential, steady temperature, pressure, and gravitational potential. Use Python to compare one-dimensional finite-difference solutions and errors, then check that a two-dimensional pressure correction removes velocity divergence on a periodic domain.

Derive why eigenvalue problems appear in PCA, vibration analysis, quantum mechanics, and graphs from optimization and time-evolution equations. Use small examples to show eigenvalues as variances, squared angular frequencies, energies, and variation across edges. Compute principal components, vibration modes, a two-state system, and graph partitions in Python, checking residuals and conservation laws.

Derive the normal equations shared by least-squares methods and compare their roles in physics, statistics, and machine learning. Estimate a spring constant from artificial measurements, examine precision-weighted estimation and maximum likelihood with normal errors, then use Python polynomial regression to choose Ridge regularization on validation data and evaluate predictions on unseen data.

Derive why Fiedler vectors help partition graphs using the Laplacian quadratic form and a continuous relaxation of RatioCut. Check eigenvalues and sign-based partitions on four vertices, then develop spectral clustering with a normalized Laplacian. Use Python to partition two-moons data and compare the result with ordinary K-means.

Explain the eigenvalues of an undirected graph Laplacian through squared differences across edges. Use a three-vertex hand calculation and Python to check that the number of zero eigenvalues equals the number of connected components. Vary the weight of an edge joining two vertex groups and compare the second eigenvalue, eigenvectors, and diffusion decay rates to show why weak connections slow heat transfer.

Explain least squares as the orthogonal projection of an observation vector onto a column space. Derive the normal equations from projection onto a line and check that the projection matrix is symmetric and idempotent. Compare a three-point regression by hand and in Python, plot residual orthogonality, and examine QR factorization and repeated columns with nonunique coefficients.

Derive ordinary least squares (OLS) from maximum likelihood under independent normal errors with equal variance. Obtain the normal equations from the log-likelihood and work through a four-point regression by hand. Use Python, plots, and repeated simulations to compare OLS with numerical optimization, relate residual sums of squares to likelihood, and distinguish maximum-likelihood and unbiased variance estimates.

Derive generalized linear models (GLMs) from the exponential family. Differentiate the normalization condition to obtain means and variances, and compare normal, Bernoulli, and Poisson distributions. Derive iteratively reweighted least squares (IRLS) from maximum likelihood with a canonical link, implement Poisson regression on artificial data in Python, and check the result against SciPy optimization.

A canonical link makes the linear predictor of a generalized linear model equal to its natural parameter. Derive the identity, logit, and log links from normal, Bernoulli, and Poisson distributions, and plot their relations to the mean. Estimate regression coefficients by maximum likelihood in Python, explain why the gradient and Hessian simplify, and compare with a probit link.

Explain how a matrix condition number affects the accuracy of a linear-system solution. Keep the matrix fixed, perturb the right-hand side, and derive a bound on relative error amplification. Use Python to examine singular values, ellipses, error directions, and inaccurate solutions with small residuals, while distinguishing problem conditioning from algorithm stability.

A Hilbert matrix has an inverse, yet small input errors can greatly change the solution of a linear system. Use an integral to prove invertibility and the condition number to explain error amplification. Compare residuals and solution errors in Python, and plot the difference between rebuilding inputs at high precision and reusing inputs rounded to double precision.

Reproduce three failures of Newton’s method in Python: iterates that alternate between zero and one, iterates whose absolute values double, and an update blocked by a zero derivative. Explain each with update formulas and plots. Compare different starting points and Brent’s method, checking residuals and stopping reasons as well as final values.

Derive why Newton’s method converges at least quadratically near a simple root using tangent lines and a Taylor expansion. Compute a square root in Python to check error reduction, error ratios, and convergence order. Compare slower convergence at a multiple root and failure to converge from some starting points, and use plots to show the accuracy limit caused by rounding errors.

Explains the Generalized Bass Model (GBM), incorporating advertising and price cuts into new product diffusion forecasting, with Python simulations.

Organizes the theoretical correspondence between the vector field operator div·grad = Δ and the Laplacian matrix in graph theory, as a personal reference note.

Compares the Bass Model for new product diffusion with the SIR model for infectious disease spread, explaining their mathematical similarities and differences.

Explains the theoretical background of the Bass Diffusion Model for predicting new product adoption, with Python simulations and fitting to sample data.

Explains the Gumbel distribution, a core concept in extreme value statistics, with Python-based parameter estimation, visualization, and the Gumbel-Max Trick.

Explains the rating matrix, adjacency matrix, degree matrix, and Laplacian matrix used in recommender systems, computing them with Python's Networkx library.

Explains association analysis with Apriori and FP-Growth via mlxtend, covering support, confidence, and lift metrics, applied to a Kaggle grocery dataset.

Introduces RFM analysis and demonstrates generating dummy purchase data with Faker and Poisson/Gamma distributions, stored in SQLite via Python's sqlite3 module.

Explains the definition and properties of doubly stochastic matrices and their applications in machine learning and recommender systems, with a Python example.

Explains the theory of low-pass filters in graph signal processing based on eigenvalue decomposition and eigenvectors, with a Python implementation.

Explains the theory of the graph Laplacian and its eigenvalues, introduces the Graph Fourier Transform (GFT), and its Python implementation.

Explains the Neumann series, its convergence condition, and how it approximates matrix inverses like (I - aA)^{-1}, with a Python implementation example.

Derives the spectral decomposition of symmetric matrices from eigenvalues and eigenvectors, relates it to SVD, and gives a Python implementation example.

Compiles useful matrix formulas from the Matrix Cookbook covering transpose, trace, determinant, differentiation, and the Woodbury inversion identity.

Explains matrix cofactors and cofactor expansion with worked examples, and implements determinant calculation via cofactors in Python.

Explains the relationship between spatial convolution and frequency-domain element-wise multiplication in graph signal processing, with theory and Python examples for GNNs.

Summarizes the basic theory and Python implementation of GNNs (Graph Neural Networks) and GCNs (Graph Convolutional Networks), a specific type of GNN.

Explains five matrix decompositions—Cholesky, LU, QR, spectral, and singular value decomposition—with theory and Python implementation examples.

Explains properties of the Rayleigh quotient for symmetric matrices, proves its max/min via Lagrange multipliers, with a Python example.

Explains SVD and PCA fundamentals with NumPy code examples, and how SVD enables low-rank approximation for recommender system rating matrices.

Explains the definition and computation of the pseudo-inverse for matrices that lack a true inverse due to rank deficiency, with a Python example.

Explains singular value decomposition with a recommender system's user-item matrix, and how low-rank approximation predicts user preferences.

Reviews the classical conjugate gradient method for solving linear equations, then studies qiskit's HHL algorithm for quantum linear system solving.

Explains Grover's algorithm, which searches unsorted data in O(√N) time, describing amplitude amplification theory as a rotation operation in vector space.

Reviews how RSA cryptography works, then explains Shor's algorithm, which could break RSA by using order-finding to perform prime factorization on a quantum computer.

Explains the theory of quantum phase estimation, combining phase kickback with the inverse quantum Fourier transform, then implements it in qiskit using a T-gate example.

Reviews the classical discrete Fourier transform and then applies the same idea to quantum states, explaining the theory of the quantum Fourier transform with qiskit.

Explains Simon's algorithm, which determines whether a function is one-to-one or two-to-one and finds the period of a two-to-one function, following the math step by step.

Explains the Deutsch-Jozsa algorithm, which determines with a single query whether a function is constant or balanced, following the underlying math step by step.

A personal summary of PageRank and the Google matrix, based on a reference textbook, covering the underlying theory and key mathematical formulas.

Explains how to represent two-qubit and three-qubit states using the tensor product, and covers the basics of multi-qubit gate operations in qiskit.

An introductory article on qiskit's basic syntax, creating quantum registers, and single-qubit operations such as the Hadamard and CNOT gates.

Explains the mathematical background and algorithms of DeepWalk and Node2Vec, random-walk graph embedding methods, with Python examples.

Explains classical random walks and adjacency matrices, focusing on PageRank and Personalized PageRank, with formulas and Python code examples.

Explains the formulation and optimization problem of matrix factorization in recommender systems, with an SVD implementation using movielens-100k.

Explains evaluation methods for recommender systems, from accuracy metrics like precision and recall to offline and online evaluation, with Python examples.

Explains content-based filtering and how cosine similarity between feature vectors drives recommendations, with a Python example.

Explains user-based and item-based memory-based collaborative filtering via cosine similarity and Pearson correlation, with a Python example.

Introduces the Surprise Python library for building recommender systems, covering its features and a matrix-factorization implementation example.

Explains how to use the implicit recommender library, covering the ALS and BPR algorithms with a movielens-100k dataset example.