Econometrics bridge: Distributed lags, moving filters, local features
Estimated time: 85 min
Lab: Open browser lab
Code: Python · R
Why this should feel familiar
A convolutional neural network repeatedly applies the same small set of weights across nearby positions. In time-series language, it resembles a learned moving filter whose coefficients are shared wherever the filter is applied.
Mathematical core
For a one-dimensional signal \(x_t\) and kernel \(k_j\), a convolution-like operation is
\[ y_t=\sum_{j=0}^{m-1} k_j x_{t+j}. \]For an image, the same kernel slides across rows and columns. A CNN learns the kernel coefficients rather than fixing them by hand. Sharing weights reduces the parameter count and encodes the assumption that a local pattern is useful regardless of its exact position.
A nonlinear layer typically applies
\[ h_{ij}=\phi((K*X)_{ij}+b). \]Stacking layers expands the effective receptive field.
Plain-English translation
The econometric bridge is a local filter with parameter restrictions: the same coefficients are reused across locations. This built-in structure can be more data-efficient than a fully connected model that gives every pixel-position interaction a separate coefficient.
What changes when we move from econometrics to AI?
The recurring shift is from a small, analyst-specified representation toward a larger learned representation. The underlying statistical questions do not disappear: What is the sample? What is conditioned on? What is estimated? What objective is optimized? Which observations were used to choose hyperparameters? How will uncertainty and distribution shift be handled?
AI terminology becomes much easier when these questions are kept explicit. Whenever you encounter a new architecture, identify four objects: inputs, parameterized transformation, training objective, and evaluation design.
Interactive browser lab
Draw an 8×8 pattern and apply edge/blur/sharpen kernels. Watch the feature map respond to local structure.
Before changing a control, predict the direction of the effect. Then manipulate one control at a time. The goal is not merely to produce a pretty visualization; it is to connect a parameter change to a mathematical statement.
Python and R lab
The Python and R examples implement the same core object as the browser lab. The Python code intentionally favors NumPy and explicit matrix operations. The R code favors base R and explicit loops/matrix algebra. Once the mechanics are clear, the same ideas can be implemented with PyTorch, TensorFlow, JAX, torch for R, or other frameworks.
Check your understanding
- Identify the random variables, observed variables, and estimated parameters in this module.
- State the objective function or equilibrium condition.
- Name the closest concept you already knew from econometrics and one important difference.
- Predict one failure mode caused by poor data, poor optimization, or poor evaluation.
Learner output
Explain why weight sharing is both a computational trick and a substantive modeling assumption.