Selection Criteria for Data-Driven Models

Alexandre René

a.rene@physik.rwth-aachen.de

NDy'23 workshop, Castro-Urdiales, 13 June 2023

These days, parameter searches can be increasingly automated with machine learning

⇒ more parameters

⇒ more models

Complex models can have degenerate parameter solutions

Prinz et al, Similar network activity from disparate circuit parameters, Nat. Neurosci. (2004)

Brute force search of 20’000’000 parameter combinations

Complex models can have degenerate parameter solutions

Models: Prinz et al (2004)

Own simulations

\(Θ_A\)

\(Θ_B\)

\(Θ_D\)

\(Θ_C\)

(LP #1)

(LP #2)

(LP #3)

(LP #5)

(LP #4)

Recorded input

Recorded input

Our goal

Define a probabilistic criterion for selecting between
specific parameter vectors

Model neurons distinguished by 8 channel conductances

Model
LP 1       8     40     75
LP 2       6     30     50
LP 3      10     50    100
LP 4       4     20     25
LP 5       6     30     50

\(g(I_{\mathrm{CaS}})\)

\(g(I_{\mathrm{A}})\)

\(g(I_{\mathrm{Kd}})\)

+5

\(Θ_A\) vs \(Θ_C\) – 9 :  1

\(Θ_A\) vs \(Θ_B\) – 3 : 2

Odds ratio

\begin{array}{lcc} & \cdot \text{ vs } Θ_A & \cdot \text{ vs } Θ_B & \cdot \text{ vs } Θ_C \\ Θ_A \text{ vs } \cdot & & 60 \% & 90 \% \\ Θ_B \text{ vs } \cdot & 40 \% & & 85 \% \\ Θ_C \text{ vs } \cdot & 10 \% & 15 \% & \end{array}

Confusion matrix

Is this not just model selection ?

Model selection

No.

Why would we want to do this ?

  • We want to interpret the parameters.
  • We think a single set of parameters should exist.
  • The model is overparameterized
    • for interpretability;
    • because it is a neural network.
  • …

Multi-modal posterior

Non-convex optimization

Compare global maxima

Integrate over all parameters

(frequentist)

(bayesian)

≠     Parameter selection

Compare specific parameter vectors

\begin{aligned} y_A &\sim \mathcal{N}(0, σ^2) \end{aligned}
\begin{aligned} y_B &\sim \mathcal{N}(μ, σ^2) \end{aligned}

vs.

\begin{aligned} Θ_A = (μ_A, σ_A) \end{aligned}
\begin{aligned} Θ_B = (μ_B, σ_B) \end{aligned}

vs.

Model A

Model B

vs

Outline

Some common model selection methods

  • AIC
  • WAIC
  • …
  • Bayes factor
  • Cross-validation
  • …
\left. \vphantom{\begin{aligned} \\[1ex] \end{aligned}} \right\rbrace

Compare
log likelihood
of global maxima

Integrate
likelihood
over parameters

\left. \vphantom{\begin{aligned} \\[5.7ex] \end{aligned}} \right\rbrace

Only make sense when comparing models with different equations

\left. \vphantom{\begin{aligned} \\[1ex] \end{aligned}} \right\rbrace
\displaystyle \bar{l}^{\,\mathrm{AIC}}_A > \bar{l}^{\,\mathrm{AIC}}_B
\displaystyle \bar{l}^{\,\text{Bayes}}_A > \bar{l}^{\,\text{Bayes}}_B

For a unifying overview, see Vehtari, Gelman, Gabra (2017)

\begin{alignedat}{6} \bar{l}^{\,\mathrm{AIC}}_A &\,=\, &&\argmax_{Θ_A}\,& \log p\;&( &\{y_i\}_i^L\;\, &\mid & \mathcal{M}_A\;\; &, Θ_A) &&+\log k \\ &\,=\, &&\argmax_{Θ_A}\;& \text{\small log likelihood}&( &\text{\small data} &\mid & \text{\small model} &, Θ_A) &&+\log (\text{\small \# parameters}) \end{alignedat}
\displaystyle \bar{l}^{\,\text{Bayes}}_A = \log \int \!\! dΘ_A \; p(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A) \, π(Θ_A)

Criteria

For single parameters, all criteria come down to log-odds

  • AIC
  • WAIC
  • …
  • Bayes factor
  • Cross-validation
  • …
\left. \vphantom{\begin{aligned} \\[1ex] \end{aligned}} \right\rbrace

Compare
log likelihood
of global maxima

Integrate
likelihood
over parameters

\left. \vphantom{\begin{aligned} \\[5.7ex] \end{aligned}} \right\rbrace
\left. \vphantom{\begin{aligned} \\[1ex] \end{aligned}} \right\rbrace
\displaystyle \bar{l}^{\,\mathrm{AIC}}_A > \bar{l}^{\,\mathrm{AIC}}_B

Criteria

\displaystyle \bar{l}^{\,\text{Bayes}}_A > \bar{l}^{\,\text{Bayes}}_B

For a unifying overview, see Vehtari, Gelman, Gabra (2017)

\bar{l}^{\,\mathrm{AIC}}_A = \log p( y \mid \mathcal{M}_A , Θ_A) +\log k
\displaystyle \bar{l}^{\,\text{Bayes}}_A = \log p(y \mid \mathcal{M}_A, Θ_A) + \log π(Θ_A)

Expected log likelihood

\displaystyle \mathrm{ell} = \mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A\bigr)\Bigr]

Expected pointwise log likelihood

\displaystyle \mathrm{epll} = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A\bigr)\Bigr]
\mathrm{ell}_A > \mathrm{ell}_B
\mathrm{epll}_A > \mathrm{epll}_B

We really want to maximize the likelihood on unseen data, ergo:

\displaystyle \bar{l}^{\,\text{Bayes}}_A = \log \int \!\! dΘ_A \; p(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A) \, π(Θ_A)
\begin{alignedat}{6} \bar{l}^{\,\mathrm{AIC}}_A &\,=\, &&\argmax_{Θ_A}\,& \log p\;&( &\{y_i\}_i^L\;\, &\mid & \mathcal{M}_A\;\; &, Θ_A) &&+\log k \end{alignedat}

Only make sense when comparing models with different equations

  • we change the dataset size / sampling rate;
  • we have modelling errors.

Criterion should be well-behaved when

Expected log likelihood

\displaystyle \mathrm{ell} = \mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A\bigr)\Bigr]

Expected pointwise log likelihood

\displaystyle \mathrm{epll} = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A\bigr)\Bigr]
\mathrm{ell}_A > \mathrm{ell}_B
\mathrm{epll}_A > \mathrm{epll}_B

Requirements

\(\mathrm{ell}\) difference increases with dataset size

⇒ unbounded confidence

\(\mathrm{epll}\) does saturates with dataset size…

\displaystyle \mathrm{epll} = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid \mathcal{M}_A, Θ_A\bigr)\Bigr]

Expected pointwise log likelihood

… but is still unstable w.r.t. modelling errors

!

… and is not interpretable as a probability.

!

Criteria

Physical model

Observation model

\displaystyle z = e^{-λx}
\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle \begin{aligned}\textstyle C \, \frac{dV_i}{dt} &= - \sum_{\mathclap{a \in \text{ion channels}}} g_a(t) \, \bigl(V_i - E_a(t) \bigr) \\ &\quad - \sum_{\mathclap{j \in \text{neurons}}} g^s_{ij} \, s_j(t) \, (V_i - E_s) \end{aligned}
\displaystyle y_t \sim \mathcal{N}(z_{t-τ}, σ^2)

Equations motivated by theory/experiment

  • We do not want to change them
  • Parameters are interpretable

Equations typically ad hoc

  • Account for (un)known noise sources
  • If we could, we would eliminate the noise
    • Actual parameter values unimportant

Physical model

Observation model

\displaystyle z = e^{-λx}
\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle \begin{aligned}\textstyle C \, \frac{dV_i}{dt} &= - \sum_{\mathclap{a \in \text{ion channels}}} g_a(t) \, \bigl(V_i - E_a(t) \bigr) \\ &\quad - \sum_{\mathclap{j \in \text{neurons}}} g^s_{ij} \, s_j(t) \, (V_i - E_s) \end{aligned}
\displaystyle y_t \sim \mathcal{N}(z_{t-τ}, σ^2)

Equations motivated by theory/experiment

  • We do not want to change them
  • Parameters are interpretable

Equations typically ad hoc

  • Account for (un)known noise sources
  • If we could, we would eliminate the noise
    • Actual parameter values unimportant

Standard model selection

computes the \(\mathrm{epll}\) for
(physical + observation) models together

Physical model

Observation model

\displaystyle z = e^{-λx}
\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle \begin{aligned}\textstyle C \, \frac{dV_i}{dt} &= - \sum_{\mathclap{a \in \text{ion channels}}} g_a(t) \, \bigl(V_i - E_a(t) \bigr) \\ &\quad - \sum_{\mathclap{j \in \text{neurons}}} g^s_{ij} \, s_j(t) \, (V_i - E_s) \end{aligned}
\displaystyle y_t \sim \mathcal{N}(z_{t-τ}, σ^2)

Equations motivated by theory/experiment

  • We do not want to change them
  • Parameters are interpretable

Equations typically ad hoc

  • Account for (un)known noise sources
  • If we could, we would eliminate the noise
    • Actual parameter values unimportant

Our approach

computes the \(\mathrm{epll}\) for
only the physical model

Physical model

Observation model

\displaystyle z = e^{-λx}
\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle \begin{aligned}\textstyle C \, \frac{dV_i}{dt} &= - \sum_{\mathclap{a \in \text{ion channels}}} g_a(t) \, \bigl(V_i - E_a(t) \bigr) \\ &\quad - \sum_{\mathclap{j \in \text{neurons}}} g^s_{ij} \, s_j(t) \, (V_i - E_s) \end{aligned}
\displaystyle y_t \sim \mathcal{N}(z_{t-τ}, σ^2)

Equations motivated by theory/experiment

  • We do not want to change them
  • Parameters are interpretable

Equations typically ad hoc

  • Account for (un)known noise sources
  • If we could, we would eliminate the noise
    • Actual parameter values unimportant

Our approach

computes the \(\mathrm{epll}\) for
only the physical model

and tests for robustness under variations of the observation model

Our approach

computes the \(\mathrm{epll}\) for
only the physical model

and tests for robustness under variations of the observation model

Log-odds criterion

  • Expectation over data
  • Conditioned on physical model
  • Conditioned on
    observation model
\displaystyle \mathrm{epll}_A = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid Θ_A\bigr)\Bigr]

Confusion criterion

  • Expectation over data
  • Conditioned on physical model
  • Random variable over observation models

Confusion criterion

  • Expectation over data
  • Conditioned on physical model
  • Random variable over observation models

This yields a non-binary criterion, which quantifies the probability of confusing two models.

We use conservative approximations
(biased towards 50%) to avoid overconfidence

\begin{array}{l|cc} & \cdot \text{ vs } Θ_A & \cdot \text{ vs } Θ_B & \cdot \text{ vs } Θ_C & \cdot \text{ vs } Θ_D \\ \hline Θ_A \text{ vs } \cdot & & 28 \% & 87 \% & 85 \% \\ Θ_B \text{ vs } \cdot & 72 \% & & 95 \% & 94 \% \\ Θ_C \text{ vs } \cdot & 13 \% & 5 \% & & 47 \% \\ Θ_D \text{ vs } \cdot & 15 \% & 7 \% & 53 \% & \\ \end{array}
B^{\mathrm{conf}}(\text{row},\text{col})
\displaystyle B^{\mathrm{conf}}(A,B) = P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)
\displaystyle P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)
\displaystyle \mathrm{epll}_A = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid Θ_A\bigr)\Bigr]

and tests for robustness under variations of the observation model

Our approach

computes the \(\mathrm{epll}\) for
only the physical model

Define the criterion

Compute the criterion

Confusion criterion

  • Expectation over data
  • Conditioned on physical model
  • Random variable over observation models

This yields a non-binary criterion, which quantifies the probability of confusing two models.

\begin{array}{l|cc} & \cdot \text{ vs } Θ_A & \cdot \text{ vs } Θ_B & \cdot \text{ vs } Θ_C & \cdot \text{ vs } Θ_D \\ \hline Θ_A \text{ vs } \cdot & & 28 \% & 87 \% & 85 \% \\ Θ_B \text{ vs } \cdot & 72 \% & & 95 \% & 94 \% \\ Θ_C \text{ vs } \cdot & 13 \% & 5 \% & & 47 \% \\ Θ_D \text{ vs } \cdot & 15 \% & 7 \% & 53 \% & \\ \end{array}
B^{\mathrm{conf}}(\text{row},\text{col})
\displaystyle B^{\mathrm{conf}}(A,B) = P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)
\mathrm{ell}_A > \mathrm{ell}_B
\mathrm{epll}_A > \mathrm{epll}_B

Criteria

\displaystyle P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)
\displaystyle \mathrm{epll}_A = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid Θ_A\bigr)\Bigr]

and tests for robustness under variations of the observation model

Our approach

computes the \(\mathrm{epll}\) for
only the physical model

Compute the criterion

Physical vs observation models

\displaystyle \mathrm{epll}_A = \frac{1}{L}\mathbb{E}_{\{y_i\}_i^L}\Bigl[\log p\bigl(\{y_i\}_i^L \mid Θ_A\bigr)\Bigr]
\displaystyle \mathrm{epll}_A = \mathbb{E}_{y_i}\Bigl[\log p\bigl(y_i \mid Θ_A\bigr)\Bigr]
\displaystyle \mathrm{epll}_A = \mathbb{E}_{y_{\hphantom{i}}}\Bigl[\log p\bigl(y_{\hphantom{i}} \mid Θ_A\bigr)\Bigr]

Define the criterion

Compute the criterion

\displaystyle \mathrm{epll}_A = \mathbb{E}_{y_{\hphantom{i}}}\Bigl[\log p\bigl(y_{\hphantom{i}} \mid Θ_A\bigr)\Bigr]

Illustration model

Physical model :

\displaystyle z = e^{-λx}

Observation model :

\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle = \int \!d{\color{#188a68} Φ_{\text{synth}}}(l)\; l

\(n\)-d integral →

\(1\)-d integral →

\displaystyle = \int \!dl\; {\color{#188a68} p_{\text{synth}}}(l)\, l
\displaystyle \mathrm{epll}_A \approx \mathbb{E}_{\color{#188a68} y \sim \text{model}}\Bigl[\log p_{\text{model}}\bigl(y \mid Θ_A\bigr)\Bigr]
\displaystyle = \int \!dy\; {\color{#188a68} p_{\text{model}}}(y)\, \underbrace{\log p_{\text{model}}\bigl(y\mid Θ_A\bigr)}_{:=\, l}
\displaystyle = \int \!d{\color{#b14b01} Φ_{\text{mixed}}}(l)\; l
\displaystyle = \int \!dl\; {\color{#b14b01} p_{\text{mixed}}}(l)\, l
\displaystyle \mathrm{epll}_A \approx \mathbb{E}_{\color{#b14b01} y \sim \text{data}}\;\,\Bigl[\log p_{\text{model}}\bigl(y \mid Θ_A\bigr)\Bigr]

Define the criterion

Compute the criterion

Illustration model

Physical model :

\displaystyle z = e^{-λx}

Observation model :

\displaystyle y \sim \mathcal{N}(z, σ^2)
\displaystyle \mathrm{epll}_A \approx \mathbb{E}_{\color{#188a68} y \sim \text{model}}\Bigl[\log p_{\text{model}}\bigl(y \mid Θ_A\bigr)\Bigr]
\displaystyle \mathrm{epll}_A \approx \mathbb{E}_{\color{#b14b01} y \sim \text{data}}\;\,\Bigl[\log p_{\text{model}}\bigl(y \mid Θ_A\bigr)\Bigr]
\displaystyle = \int \!d{\color{#188a68} Φ_{\text{synth}}}(l)\; l
\displaystyle = \int \!d{\color{#b14b01} Φ_{\text{mixed}}}(l)\; l
\mathop{\mathrm{EMD}}(Φ) := \bigl\lvert {\color{#188a68} l_{\text{synth}}}(Φ) - {\color{#b14b01} l_{\text{mixed}}}(Φ) \bigr\rvert

Each sampled path corresponds to an observation model

Assumptions

\begin{aligned} \mathbb{E}_a(Δl(Φ)) &= Δl_{\text{mixed}}(Φ) \\ \mathop{\mathrm{MVar}}\bigl(Δl(Φ)\bigr) &= c \mathop{\mathrm{EMD(Φ)}} \end{aligned}
\displaystyle \begin{aligned} \mathrm{epll}_A &\approx \int \!d{\color{#188a68} Φ_{\text{synth}}}(l)\; l \\ &\approx \int \!d{\color{#b14b01} Φ_{\text{mixed}}}(l)\; l \end{aligned}

Empirical model discrepancy

Define the criterion

Compute the criterion

Limitations of
log-odds

Physical vs observation models

Sample observation models

Calibrate the EMD approximation

\mathop{\mathrm{EMD}}(Φ) := \bigl\lvert {\color{#188a68} l_{\text{synth}}}(Φ) - {\color{#b14b01} l_{\text{mixed}}}(Φ) \bigr\rvert
\displaystyle \begin{aligned} \mathrm{epll}_A &\approx \int \!d{\color{#188a68} Φ_{\text{synth}}}(l)\; l \\ &\approx \int \!d{\color{#b14b01} Φ_{\text{mixed}}}(l)\; l \end{aligned}

Assumptions

\begin{aligned} \mathbb{E}_a(Δl(Φ)) &= Δl_{\text{mixed}}(Φ) \\ \mathop{\mathrm{MVar}}\bigl(Δl(Φ)\bigr) &= c \mathop{\mathrm{EMD(Φ)}} \end{aligned}

Evaluate \(\mathrm{epll}\) for each sampled \(l(Φ)\) path

\begin{aligned} &\color{#6ebfe6} \mathrm{epll}_{\text{true}} \\[-.75ex] &\color{#e5904c} \mathrm{epll}_{A} \\[-.75ex] &\color{#9f9ccb} \mathrm{epll}_B \end{aligned}

Define the criterion

Compute the criterion

Limitations of
log-odds

Physical vs observation models

Sample observation models

Calibrate the EMD approximation

Assumptions

\begin{aligned} \mathbb{E}_a(Δl(Φ)) &= l_{\text{mixed}}(Φ) \\ \mathop{\mathrm{MVar}}\bigl(Δl(Φ)\bigr) &= c \mathop{\mathrm{EMD(Φ)}} \end{aligned}

Criterion

\displaystyle B^{\mathrm{conf}}_{AB} = P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)

\(B^{\mathrm{EMD}}\) is an approximation of \(B^{\mathrm{conf}}\) based on our assumptions

⇒ Construct a simulated experiment with known model mismatch to calibrate \(c\).

Red is the overconfidence region

Summary

Compute the criterion

Calibrate the EMD approximation

Criteria

\displaystyle P\bigl( \mathrm{epll}_A > \mathrm{epll}_B \bigr)
\mathrm{epll}_A > \mathrm{epll}_B

Define the criterion

Limitations of
log-odds

Physical vs observation models

Sample observation models

Acknowledgments

Prof. André Longtin (Ottawa)

Prof. Moritz Helias (RWTH, FZ Jülich)

Prof. Carsten Honerkamp (RWTH)

Prof. Jakob H. Macke (Tübingen)

Colleagues

Claudia Merger

Peter Bouss

Sandra Nestler

Anno Kürth

Dr. Christian Keup (now EPFL)

Jan Bölts (Tübingen)

Advisory support

Funding

INM-6 group (FZ Jülich)

Extra slides

Likelihood commutative diagram

Likelihoods – exponential decay model

Biased

Unbiased

Whole dataset

Per data point

Calibration – Explanation figure