Skip to content

Commit 4bb73be

Browse files
committed
add identifiability tutorial
1 parent 392b8aa commit 4bb73be

File tree

1 file changed

+60
-35
lines changed

1 file changed

+60
-35
lines changed

docs/src/tutorials/parameter_identifiability.md

Lines changed: 60 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -75,51 +75,76 @@ In this tutorial, let us cover an example problem of querying the ODE for global
7575

7676
Let us consider the following four-dimensional model with two outputs:
7777

78-
$\begin{cases}x'(t) = lm - d \, x(t) - \beta \, x(t) \, v(t),\\
79-
y'(t) = \beta \, x(t) \, v(t) - a \, y(t),\\
80-
v'(t) = k \, y(t) - u \, v(t),\\
81-
w'(t) = c \, x(t) \, y(t) \, w(t) - c \, q \, y(t) \, w(t) - b \, w(t),\\
82-
z'(t) = c \, q \, y(t) \, w(t) - h \, z(t),\\
83-
y_1(t) = w(t),\\
84-
y_2(t) = z(t)\end{cases}$
78+
$$\begin{cases}
79+
x_1'(t) = -b x_1(t) + \frac{1 }{ c + x_4(t)},\\
80+
x_2'(t) = \alpha x_1(t) - \beta x_2(t),\\
81+
x_3'(t) = \gamma x_2(t) - \delta x_3(t),\\
82+
x_4'(t) = \sigma x_4(t) \frac{(\gamma x_2(t) - \delta x_3(t))}{ x_3(t)},\\
83+
y(t) = x_1(t)
84+
\end{cases}$$
8585

86-
This model describes HIV dynamics[^1]. Let us run a global identifiability check on this model to get the result with probability of correctness being `p=0.999`. To do this, we will use `assess_identifiability(ode, p)` function.
86+
This model describes enzyme dynamics[^3]. Let us run a global identifiability check on this model. We will use the default settings: the probability of correctness will be `p=0.99` and we are interested in identifiability of all possible parameters
8787

8888
Global identifiability needs information about local identifiability first, hence the function we chose here will take care of that extra step for us.
8989

9090
```@repl
91-
using StructuralIdentifiability
92-
93-
ode = @ODEmodel(
94-
x'(t) = lm - d * x(t) - beta * x(t) * v(t),
95-
y'(t) = beta * x(t) * v(t) - a * y(t),
96-
v'(t) = k * y(t) - u * v(t),
97-
w'(t) = c * x(t) * y(t) * w(t) - c * q * y(t) * w(t) - b * w(t),
98-
z'(t) = c * q * y(t) * w(t) - h * z(t),
99-
y1(t) = w(t),
100-
y2(t) = z(t)
101-
)
102-
@time global_id = assess_identifiability(ode, 0.999)
91+
using StructuralIdentifiability, ModelingToolkit
92+
@parameters b c α β γ δ σ
93+
@variables t x1(t) x2(t) x3(t) x4(t) y(t)
94+
D = Differential(t)
95+
96+
eqs = [
97+
D(x1) ~ -b * x1 + 1/(c + x4),
98+
D(x2) ~ α * x1 - β * x2,
99+
D(x3) ~ γ * x2 - δ * x3,
100+
D(x4) ~ σ * x4 * (γ * x2 - δ * x3)/x3
101+
]
102+
103+
observed = [
104+
y~x1
105+
]
106+
107+
# no inputs
108+
inputs = []
109+
110+
# check all parameters
111+
to_check = []
112+
113+
ode = ODESystem(eqs, t, [x1, x2, x3, x4], [b, c, α, β, γ, δ, σ], observed=observed, name=:GoodwinOsc)
114+
115+
@time global_id = assess_identifiability(ode, inputs, to_check, 0.99)
103116
```
104117

105-
Now let us compare the same system but with probability being `p=0.99`. We will see a reduction in runtime:
118+
Let us consider the same system but with two inputs and we will try to find out identifiability with probability `0.9` for parameters `c` and `b`:
106119

107120
```@repl
108-
using StructuralIdentifiability
109-
110-
ode = @ODEmodel(
111-
x'(t) = lm - d * x(t) - beta * x(t) * v(t),
112-
y'(t) = beta * x(t) * v(t) - a * y(t),
113-
v'(t) = k * y(t) - u * v(t),
114-
w'(t) = c * x(t) * y(t) * w(t) - c * q * y(t) * w(t) - b * w(t),
115-
z'(t) = c * q * y(t) * w(t) - h * z(t),
116-
y1(t) = w(t),
117-
y2(t) = z(t)
118-
)
119-
@time global_id = assess_identifiability(ode, 0.99)
121+
using StructuralIdentifiability, ModelingToolkit
122+
@parameters b c α β γ δ σ
123+
@variables t x1(t) x2(t) x3(t) x4(t) y(t) u1 u2
124+
D = Differential(t)
125+
126+
eqs = [
127+
D(x1) ~ -b * x1 + 1/(c + x4),
128+
D(x2) ~ α * x1 - β * x2 - u1,
129+
D(x3) ~ γ * x2 - δ * x3 + u2,
130+
D(x4) ~ σ * x4 * (γ * x2 - δ * x3)/x3
131+
]
132+
133+
observed = [
134+
y~x1
135+
]
136+
137+
# no inputs
138+
inputs = [u1, u2]
139+
140+
# check all parameters
141+
to_check = [b, c]
142+
143+
ode = ODESystem(eqs, t, [x1, x2, x3, x4], [b, c, α, β, γ, δ, σ], observed=observed, name=:GoodwinOsc)
144+
145+
@time global_id = assess_identifiability(ode, inputs, to_check, 0.9)
120146
```
121147

122-
Indeed, notice how much quicker we obtained the result with 99% correctness guarantee! This illustrates the fact that you may sometimes sacrifice probability slightly to get results much faster.
123148

124149
[^1]:
125150
> R. Munoz-Tamayo, L. Puillet, J.B. Daniel, D. Sauvant, O. Martin, M. Taghipoor, P. Blavy [*Review: To be or not to be an identifiable model. Is this a relevant question in animal science modelling?*](https://doi.org/10.1017/S1751731117002774), Animal, Vol 12 (4), 701-712, 2018. The model is the ODE system (3) in Supplementary Material 2, initial conditions are assumed to be unknown.
@@ -128,4 +153,4 @@ Indeed, notice how much quicker we obtained the result with 99% correctness guar
128153
> Moate P.J., Boston R.C., Jenkins T.C. and Lean I.J., [*Kinetics of Ruminal Lipolysis of Triacylglycerol and Biohydrogenationof Long-Chain Fatty Acids: New Insights from Old Data*](doi:10.3168/jds.2007-0398), Journal of Dairy Science 91, 731–742, 2008
129154
130155
[^3]:
131-
> D. Wodarz, M. Nowak, [*Specific therapy regimes could lead to long-term immunological control of HIV*](https://doi.org/10.1073/pnas.96.25.14464), PNAS December 7, 1999 96 (25) 14464-14469;
156+
> Goodwin, B.C. [*Oscillatory behavior in enzymatic control processes*](https://doi.org/10.1016/0065-2571(65)90067-1), Advances in Enzyme Regulation, Vol 3 (C), 425-437, 1965

0 commit comments

Comments
 (0)