### Install StructuralIdentifiability.jl Source: https://docs.sciml.ai/StructuralIdentifiability/stable Use the Julia package manager to add the StructuralIdentifiability package to your environment. ```julia using Pkg Pkg.add("StructuralIdentifiability") ``` -------------------------------- ### Example: find_identifiable_functions with @ODEmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Complete example showing how to define an ODE model with @ODEmodel and call find_identifiable_functions. The output prints two identifiable functions: a12 + a01 + a21 and a12*a01. ```julia using StructuralIdentifiability ode = @ODEmodel( x0'(t) = -(a01 + a21) * x0(t) + a12 * x1(t), x1'(t) = a21 * x0(t) - a12 * x1(t), y(t) = x0(t) ) find_identifiable_functions(ode) # prints 3-element Vector{AbstractAlgebra.Generic.FracFieldElem{Nemo.QQMPolyRingElem}}: a12 + a01 + a21 a12*a01 ``` -------------------------------- ### find_submodels method signature and example Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Calculates and returns all valid submodels of the given ODE system as a list of ODE objects. The example defines a simple ODE model and calls find_submodels, showing the resulting submodel. ```julia find_submodels(ode) ``` ```julia >ode = @ODEmodel(x1'(t) = x1(t)^2, x2'(t) = x1(t) * x2(t), y1(t) = x1(t), y2(t) = x2(t)) >find_submodels(ode) ODE{QQMPolyRingElem}[ x1'(t) = a(t)*x2(t)^2 + x1(t) y1(t) = x1(t) ] ``` -------------------------------- ### Create a linear compartment model Source: https://docs.sciml.ai/StructuralIdentifiability/stable/input/input Define a linear compartment model using a graph adjacency list. The example shows a bidirected cycle with four nodes, specifying outputs, inputs, and leaks. ```julia julia> ode = linear_compartment_model([[2, 4], [1, 3], [2, 4], [1, 3]], outputs = [1], inputs = [2], leaks = [2, 3]) x1' = -x1*a_2_1 - x1*a_4_1 + x2*a_1_2 + x4*a_1_4 x3' = x2*a_3_2 - x3*a_2_3 - x3*a_4_3 - x3*a_0_3 + x4*a_3_4 x2' = x1*a_2_1 - x2*a_1_2 - x2*a_3_2 - x2*a_0_2 + x3*a_2_3 + u2 x4' = x1*a_4_1 + x3*a_4_3 - x4*a_1_4 - x4*a_3_4 y1 = x1 ``` -------------------------------- ### find_ioequations(ode, [var_change_policy=:default]) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/ioequations/ioequations Finds the input-output equations of an ODE system. Returns a dictionary from leaders to the corresponding input-output equations. ```APIDOC ## find_ioequations(ode, [var_change_policy=:default]) ### Description Finds the input-output equations of an ODE system. ### Method Function ### Signature `find_ioequations(ode, [var_change_policy=:default])` ### Parameters - `ode` - The ODE system. - `var_change_policy` - Whether to perform automatic variable change, can be one of `:default`, `:yes`, `:no`. - `loglevel` - Logging level (default: Logging.Info). ### Output A dictionary from "leaders" to the corresponding input-output equations; if an extra projection is needed, it will be the value corresponding to `rand_proj_var`. ``` -------------------------------- ### Define and assess a discrete-time system using ModelingToolkitBase Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/discrete_time Defines a system using ModelingToolkitBase and assesses its local identifiability, noting that shifts must be negative in this approach. ```julia using ModelingToolkitBase using StructuralIdentifiability @independent_variables t @parameters α β @variables S(t) I(t) R(t) k = ShiftIndex(t) eqs = [ S(k) ~ S(k - 1) - β * S(k - 1) * I(k - 1), I(k) ~ I(k - 1) + β * S(k - 1) * I(k - 1) - α * I(k - 1), R(k) ~ R(k - 1) + α * I(k - 1), ] @named sys = System(eqs, t) assess_local_identifiability(sys, measured_quantities = [I]) ``` -------------------------------- ### check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}, extra_relations::Array{QQMPolyRingElem, 1}) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/primality Checks if the ideal generated by the given polynomials and saturated at the leading coefficient with respect to the corresponding variables is prime over rationals. Additional polynomials can be provided via extra_relations without affecting the saturation. ```APIDOC ## check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}, extra_relations::Array{QQMPolyRingElem, 1}) ### Description Checks if the ideal generated by the polynomials and saturated at the leading coefficient with respect to the corresponding variables is prime over rationals. The `extra_relations` allows adding more polynomials to the generators (not affecting the saturation). ### Method Function call ### Signature ```julia check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}, extra_relations::Array{QQMPolyRingElem, 1}) ``` ### Parameters - `polys` (Dict{QQMPolyRingElem, QQMPolyRingElem}) - Required - Dictionary of polynomials generating the ideal. - `extra_relations` (Array{QQMPolyRingElem, 1}) - Required - Additional polynomials to add to the generators without affecting saturation. ### Returns - Boolean indicating whether the ideal is prime over rationals. ``` -------------------------------- ### StructuralIdentifiability.io_switch!(pbr) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/ioequations/ioequations In a single-output pb-representation, makes the leading variable to be the first of the inputs. ```APIDOC ## StructuralIdentifiability.io_switch!(pbr) ### Description In a single-output pb-representation `pbr` makes the leading variable to be the first of the inputs. ### Method Function ### Signature `io_switch(pbr)` ### Parameters - `pbr` - A projection-based representation. ``` -------------------------------- ### check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/primality Checks if the ideal generated by the given polynomials and saturated at the leading coefficient with respect to the corresponding variables is prime over rationals. ```APIDOC ## check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}) ### Description Checks if the ideal generated by the polynomials and saturated at the leading coefficient with respect to the corresponding variables is prime over rationals. ### Method Function call ### Signature ```julia check_primality(polys::Dict{QQMPolyRingElem, QQMPolyRingElem}) ``` ### Parameters - `polys` (Dict{QQMPolyRingElem, QQMPolyRingElem}) - Required - Dictionary of polynomials generating the ideal. ### Returns - Boolean indicating whether the ideal is prime over rationals. ``` -------------------------------- ### Define model with ModelingToolkit System Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/creating_ode Defines the same mutualism model using ModelingToolkit's System. The first block declares variables, parameters, and the differential operator; the second block builds the equations, measured quantities, and the System; the third block shows the printed System summary. ```julia using StructuralIdentifiability, ModelingToolkitBase @independent_variables t @parameters r1, r2, c1, c2, beta1, beta2, chi1, chi2 @variables x1(t), x2(t), y(t), u(t) D = Differential(t) ``` ```julia eqs = [ D(x1) ~ r1 * x1 * (1 - c1 * x1) + beta1 * x1 * x2 / (chi1 + x2) + u, D(x2) ~ r2 * x2 * (1 - c2 * x2) + beta2 * x1 * x2 / (chi2 + x1), ] measured_quantities = [y ~ x1] ode_mtk = System(eqs, t, name = :mutualist) ``` ```text Model mutualist: Equations (2): 2 standard: see equations(mutualist) Unknowns (3): see unknowns(mutualist) x1(t) x2(t) u(t) Parameters (8): see parameters(mutualist) beta1 chi1 c1 r1 ⋮ ``` -------------------------------- ### Macro @ODEmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/input/input Macro for creating an ODE model from a list of differential and output equations. It also injects all variables into the global scope. ```APIDOC ## Macro @ODEmodel ### Description Macro for creating an ODE from a list of equations. It also injects all variables into the global scope. ### Syntax ```julia @ODEmodel(equations...) ``` ### Parameters - `equations` (list of equations) - Required - State derivative equations (e.g., `x'(t) = ...`) and output equations (e.g., `y(t) = ...`). The equations define state variables, output variables, input variables, and parameters. ### Example ```julia using StructuralIdentifiability ode = @ODEmodel( x1'(t) = a * x1(t) + u(t), x2'(t) = b * x2(t) + c*x1(t)*x2(t), y(t) = x1(t) ) ``` Here, - `x1`, `x2` are state variables - `y` is an output variable - `u` is an input variable - `a`, `b`, `c` are time-independent parameters ``` -------------------------------- ### assess_identifiability with known_ic = [x2, x3] Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiability Call assess_identifiability with the experimental known_ic keyword argument to assume initial conditions for x2 and x3 are known. The output shows that alpha and gama become locally identifiable. ```julia assess_identifiability(ode, known_ic = [x2, x3]) ``` ```text OrderedCollections.OrderedDict{Nemo.QQMPolyRingElem, Symbol} with 11 entries: x1(0) => :globally x2(0) => :globally x3(0) => :globally x4(0) => :globally alpha => :locally b => :globally beta => :locally c => :globally delta => :locally gama => :locally sigma => :globally ``` -------------------------------- ### View the reparametrized ODE Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/reparametrization Display the original ODE rewritten in terms of the new variables. ```julia reparam[:new_ode] ``` ```text X1'(t) = -X1(t)*a2 + X4(t)*a1 X2'(t) = (-X2(t)*X3(t))//a3 X3'(t) = -X3(t)*a2 + X4(t)*a1 X4'(t) = (X2(t)*X3(t) - X4(t)*a1*a3)//a3 y1(t) = X1(t) ``` -------------------------------- ### Create an ODE system with @ODEmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/input/input Use the @ODEmodel macro to define an ODE system from a list of equations. This macro automatically injects state, output, input, and parameter variables into the global scope. ```julia using StructuralIdentifiability ode = @ODEmodel( x1'(t) = a * x1(t) + u(t), x2'(t) = b * x2(t) + c*x1(t)*x2(t), y(t) = x1(t) ) ``` -------------------------------- ### Find identifiable functions with known initial condition Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiable_functions Calls `find_identifiable_functions` with `known_ic = [x1]` to assume the initial condition `x1(0)` is known. The output includes identifiable functions of parameters and initial conditions, such as `x3(0)`, `x2(0)`, and `x1(0)`, along with the parameter combinations. ```julia find_identifiable_functions(LLW1987, known_ic = [x1]) ``` ```text 8-element Vector{AbstractAlgebra.Generic.FracFieldElem{Nemo.QQMPolyRingElem}}: x3(0) x2(0) x1(0) p1 + p3 p2*p4 p1*p3 p2*x2(0) + p4*x1(0) p1*p4*x1(0) + p2*p3*x2(0) ``` -------------------------------- ### monomial_compress(io_equation, ode) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/wronskian Compresses an input-output equation for rank computation, producing a representation with coefficients involving only parameters and terms involving only inputs and outputs, with minimal length. ```APIDOC ## monomial_compress(io_equation, ode) ### Description Compresses an input-output equation for rank computation, producing a representation with coefficients involving only parameters and terms involving only inputs and outputs, with minimal length. ### Method Function call ### Endpoint `StructuralIdentifiability.monomial_compress(io_equation, ode)` ### Parameters - **io_equation** (input-output equation) - Required - The input-output equation to compress - **ode** (ODE model) - Required - The corresponding ODE model ### Response #### Success Response - **coeffs** - Coefficients involving only parameters - **terms** - Terms involving only inputs and outputs - **sum** - Sum of `coeffs[i] * terms[i]` equals the input-output equation - **length** - The representation length is the smallest possible #### Response Example ``` (coeffs, terms) ``` ``` -------------------------------- ### Macro @DDSmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/input/input Macro for creating a discrete dynamical system (DDS) from a list of equations. It also injects all variables into the global scope. ```APIDOC ## Macro @DDSmodel ### Description Macro for creating a DDS (discrete dynamical system) from a list of equations. It also injects all variables into the global scope. ### Syntax ```julia @DDSmodel(equations...) ``` ### Parameters - `equations` (list) - Required - List of difference equations (e.g., `x(t+1) = ...`) and output equations (e.g., `y(t) = ...`). The equations define state variables, output variables, input variables, and parameters. ### Example ```julia using StructuralIdentifiability dds = @DDSmodel( x1(t + 1) = a * x1(t) + u(t), x2(t + 1) = b * x2(t) + c*x1(t)*x2(t), y(t) = x1(t) ) ``` Here, - `x1`, `x2` are state variables - `y` is an output variable - `u` is an input variable - `a`, `b`, `c` are time-independent parameters ``` -------------------------------- ### reduce_ode_mod_p method signature Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Reduces an ODE over QQ modulo a prime p. Throws an exception if p divides any denominator in the ODE. ```julia reduce_ode_mod_p(ode, p) ``` -------------------------------- ### find_identifiable_functions(ode::ODE; options...) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Finds all functions of parameters/states that are identifiable in the given ODE system. Supports options for including states, simplification level, known initial conditions, probability threshold, seed, and log level. ```APIDOC ## find_identifiable_functions(ode::ODE; options...) ### Description Finds all functions of parameters/states that are identifiable in the given ODE system. The function returns a vector of identifiable functions. ### Method Function call ### Endpoint find_identifiable_functions(ode::ODE; options...) ### Parameters #### Input Arguments - **ode** (ODE) - Required - The ODE model - **with_states** (Bool) - Optional - When true, also reports the identifiable functions in the ODE states. Default is false. - **simplify** (Symbol) - Optional - The extent to which the output functions are simplified. Possible options: :standard (default), :weak, :strong, :absent. - **known_ic** (list) - Optional - A list of functions whose initial conditions are assumed to be known; then the returned identifiable functions will be functions of parameters and initial conditions, not states (experimental) - **prob_threshold** (Float) - Optional - Probability of correctness (default: 0.99) - **seed** (Int) - Optional - The rng seed (default: 42) - **loglevel** (LogLevel) - Optional - Minimal level of log messages to display (default: Logging.Info) ### Request Example ```julia using StructuralIdentifiability ode = @ODEmodel( x0'(t) = -(a01 + a21) * x0(t) + a12 * x1(t), x1'(t) = a21 * x0(t) - a12 * x1(t), y(t) = x0(t) ) find_identifiable_functions(ode) ``` ### Response #### Success Response Returns a vector of identifiable functions. Example output: ```julia 3-element Vector{AbstractAlgebra.Generic.FracFieldElem{Nemo.QQMPolyRingElem}}: a12 + a01 + a21 a12*a01 ``` ``` -------------------------------- ### power_series_solution method signature Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Computes a power series solution of the ODE with given parameter values, initial conditions, and input power series, up to the specified precision. Returns a dictionary mapping each variable to its coordinate in the solution. ```julia power_series_solution(ode, param_values, initial_conditions, input_values, prec) ``` -------------------------------- ### Create a discrete dynamical system with @DDSmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/input/input Use the @DDSmodel macro to define a discrete-time dynamical system. Similar to @ODEmodel, it injects all variables into the global scope. ```julia using StructuralIdentifiability dds = @DDSmodel( x1(t + 1) = a * x1(t) + u(t), x2(t + 1) = b * x2(t) + c*x1(t)*x2(t), y(t) = x1(t) ) ``` -------------------------------- ### set_parameter_values method signature Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Substitutes the given parameter values into the ODE, producing a new ODE with those parameters replaced by numbers. The parameter values dictionary maps parameter names to values. ```julia set_parameter_values(ode, param_values) ``` -------------------------------- ### wronskian(io_equations, ode) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/wronskian Computes the Wronskians of a set of input-output equations evaluated at a point modulo prime. ```APIDOC ## wronskian(io_equations, ode) ### Description Computes the Wronskians of a set of input-output equations evaluated at a point modulo prime. ### Method Function call ### Endpoint `StructuralIdentifiability.wronskian(io_equations, ode)` ### Parameters - **io_equations** (set of io-equations) - Required - A set of io-equations in the form of the `Dict` as returned by `find_ioequations` - **ode** (ODE object) - Required - The `ODE` object ### Response #### Success Response - **list of Wronskians** - The Wronskians evaluated at a point modulo prime #### Response Example ``` [wronskian1, wronskian2, ...] ``` ``` -------------------------------- ### assess_local_identifiability for DDS Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Signature for checking local identifiability/observability of functions in a discrete dynamical system (DDS). Accepts a list of known_ic quantities whose initial conditions are assumed known and generic. Result is correct with probability at least prob_threshold. ```julia assess_local_identifiability(dds::DDS{P}; funcs_to_check::Array{<: Any, 1}, known_ic, prob_threshold::Float64=0.99, loglevel=Logging.Info) where P <: MPolyRingElem{Nemo.QQFieldElem} ``` -------------------------------- ### power_series_solution Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Computes a power series solution of an ODE with given parameters, initial conditions, and input values up to a specified precision. ```APIDOC ## power_series_solution(ode, param_values, initial_conditions, input_values, prec) ### Description Computes a power series solution of the given ODE with the specified precision. ### Method power_series_solution ### Parameters - **ode** (ODE) - Required - The ODE to solve. - **param_values** (Dict) - Required - Parameter values, mapping each parameter to a value. - **initial_conditions** (Dict) - Required - Initial conditions, mapping each state variable to a value. - **input_values** (Dict) - Required - Power series for the inputs, mapping each variable to a list of coefficients. - **prec** (Integer) - Required - The precision of the solution. ### Output Returns a dictionary mapping each variable to the corresponding coordinate of the power series solution. ``` -------------------------------- ### Display the LLW1987 model equations Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiable_functions Shows the expanded form of the LLW1987 model equations as they would be printed, with terms expanded and reordered. This is the output of displaying the model object. ```text x1'(t) = -x1(t)*p1 + u(t)*p2 x2'(t) = -x2(t)*p3 + u(t)*p4 x3'(t) = x1(t)*u(t)*p4 + x2(t)*u(t)*p2 - x3(t)*p1 - x3(t)*p3 y1(t) = x3(t) ``` -------------------------------- ### Define a discrete-time SIR model with @DDSmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/discrete_time Uses the @DDSmodel macro to define a discrete-time SIR model using shift notation. ```julia using StructuralIdentifiability dds = @DDSmodel( S(t + 1) = S(t) - β * S(t) * I(t), I(t + 1) = I(t) + β * S(t) * I(t) - α * I(t), R(t + 1) = R(t) + α * I(t), y(t) = I(t) ) ``` -------------------------------- ### assess_local_identifiability for ODE Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Signature for checking local identifiability/observability of specific functions in an ODE model. The type parameter can be :SE (single-experiment) or :ME (multi-experiment); for :ME, states are not allowed in funcs_to_check. Result is correct with probability at least prob_threshold. ```julia assess_local_identifiability(ode::ODE{P}; funcs_to_check::Array{<: Any, 1}, prob_threshold::Float64=0.99, type=:SE, loglevel=Logging.Info) where P <: MPolyRingElem{Nemo.QQFieldElem} ``` -------------------------------- ### Check Identifiability of Specific Functions Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiability Uses the funcs_to_check parameter to investigate the identifiability of specific parameter combinations in the Goodwin oscillator model. ```julia assess_identifiability(ode, funcs_to_check = [beta + delta, beta * delta]) ``` ```text OrderedCollections.OrderedDict{Any, Symbol} with 2 entries: beta + delta => :globally beta*delta => :globally ``` -------------------------------- ### assess_local_identifiability(ode::ODE{P}; funcs_to_check, prob_threshold, type, loglevel) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Checks local identifiability/observability of specified functions in an ODE model. The result is correct with probability at least prob_threshold. Supports single-experiment (:SE) or multi-experiment (:ME) identifiability. ```APIDOC ## assess_local_identifiability(ode::ODE{P}; funcs_to_check, prob_threshold, type, loglevel) ### Description Checks the local identifiability/observability of the functions in funcs_to_check. The result is correct with probability at least prob_threshold. Call this function if you have a specific collection of parameters of which you would like to check local identifiability. ### Method Function call ### Endpoint assess_local_identifiability(ode::ODE{P}; funcs_to_check::Array{<: Any, 1}, prob_threshold::Float64=0.99, type=:SE, loglevel=Logging.Info) where P <: MPolyRingElem{Nemo.QQFieldElem} ### Parameters #### Input Arguments - **ode** (ODE) - Required - The ODE model - **funcs_to_check** (Array) - Required - List of functions to check local identifiability - **prob_threshold** (Float) - Optional - Probability of correctness (default: 0.99) - **type** (Symbol) - Optional - Can be :SE (single-experiment identifiability) or :ME (multi-experiment identifiability). If :ME, states are not allowed to appear in funcs_to_check. - **loglevel** (LogLevel) - Optional - Minimal level of log messages to display (default: Logging.Info) ### Response #### Success Response Returns the local identifiability/observability of the functions in funcs_to_check. ``` -------------------------------- ### assess_local_identifiability(dds::DDS{P}; funcs_to_check, known_ic, prob_threshold, loglevel) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Checks local identifiability/observability of specified functions in a discrete dynamical system (DDS). The result is correct with probability at least prob_threshold. A list of quantities can be provided as known_ic for which initial conditions are assumed known and generic. ```APIDOC ## assess_local_identifiability(dds::DDS{P}; funcs_to_check, known_ic, prob_threshold, loglevel) ### Description Checks the local identifiability/observability of the functions in funcs_to_check. The result is correct with probability at least prob_threshold. A list of quantities can be provided as known_ic for which the initial conditions can be assumed to be known and generic. ### Method Function call ### Endpoint assess_local_identifiability(dds::DDS{P}; funcs_to_check::Array{<: Any, 1}, known_ic, prob_threshold::Float64=0.99, loglevel=Logging.Info) where P <: MPolyRingElem{Nemo.QQFieldElem} ### Parameters #### Input Arguments - **dds** (DDS) - Required - The discrete dynamical system - **funcs_to_check** (Array) - Required - List of functions to check local identifiability - **known_ic** (list) - Optional - A list of quantities for which the initial conditions can be assumed to be known and generic - **prob_threshold** (Float) - Optional - Probability of correctness (default: 0.99) - **loglevel** (LogLevel) - Optional - Minimal level of log messages to display (default: Logging.Info) ### Response #### Success Response Returns the local identifiability/observability of the functions in funcs_to_check. ``` -------------------------------- ### Find identifiable functions of parameters and states Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiable_functions Calls `find_identifiable_functions` with `with_states = true` to also include state variables in the search. The output includes functions of states and parameters, such as `x3(t)`, `x1(t)*x2(t)`, and combinations involving `x1(t)` and `x2(t)`. ```julia find_identifiable_functions(LLW1987, with_states = true) ``` ```text 7-element Vector{AbstractAlgebra.Generic.FracFieldElem{Nemo.QQMPolyRingElem}}: x3(t) p1 + p3 p2*p4 p1*p3 x1(t)*x2(t) x1(t)*p4 + x2(t)*p2 x1(t)*p1*p4 + x2(t)*p2*p3 ``` -------------------------------- ### reduce_ode_mod_p Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Reduces an ODE defined over the rationals modulo a prime number, throwing an exception if the prime divides any denominator. ```APIDOC ## reduce_ode_mod_p(ode, p) ### Description Reduces an ODE over QQ modulo a prime number p. ### Method reduce_ode_mod_p ### Parameters - **ode** (ODE) - Required - The ODE over QQ to reduce. - **p** (Prime) - Required - The prime number to reduce modulo. ### Output Returns the reduction of the ODE modulo p. Throws an exception if p divides one of the denominators. ``` -------------------------------- ### set_parameter_values Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Substitutes given numeric values for specified parameters in an ODE, returning a new ODE with those parameters replaced. ```APIDOC ## set_parameter_values(ode, param_values) ### Description Sets parameter values in an ODE by substituting given numeric values for the specified parameters. ### Method set_parameter_values ### Parameters - **ode** (ODE) - Required - The ODE in which to set parameter values. - **param_values** (Dict) - Required - A dictionary mapping parameters to their numeric values. ### Output Returns a new ODE with the specified parameters replaced by their given values. ``` -------------------------------- ### find_identifiable_functions signature Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Signature for finding all identifiable functions of parameters/states in an ODE system. Options include with_states, simplify (with :standard, :weak, :strong, :absent), known_ic, prob_threshold (default 0.99), seed (default 42), and loglevel. ```julia find_identifiable_functions(ode::ODE; options...) ``` -------------------------------- ### Reparametrize the model Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/reparametrization Perform global reparametrization and inspect the new variables. ```julia reparam = reparametrize_global(ode) @assert isempty(reparam[:implicit_relations]) # checking that the result is an ODE on the whole space, not on a manifold reparam[:new_vars] ``` ```text Dict{Nemo.QQMPolyRingElem, AbstractAlgebra.Generic.FracFieldElem{Nemo.QQMPolyRingElem}} with 8 entries: y1(t) => y(t) a3 => (N*a)//b X1(t) => I(t) a2 => d a1 => g X2(t) => S(t)*a X3(t) => U(t)*a + I(t)*a X4(t) => E(t)*a ``` -------------------------------- ### Assess local identifiability of a Lotka-Volterra model Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiability Defines an ODE model using the @ODEmodel macro and assesses the local identifiability of its parameters and states. ```julia using StructuralIdentifiability ode = @ODEmodel( x1'(t) = a * x1(t) - b * x1(t) * x2(t) + u(t), x2'(t) = -c * x2(t) + d * x1(t) * x2(t), y(t) = x1(t) ) assess_local_identifiability(ode) ``` ```text OrderedCollections.OrderedDict{Any, Bool} with 6 entries: x1(t) => 1 x2(t) => 0 a => 1 b => 0 c => 1 d => 1 ``` -------------------------------- ### find_submodels Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/ode Finds and returns all valid submodels of a given ODE system, each represented as an ODE object. ```APIDOC ## find_submodels(ode) ### Description Calculates and returns all valid submodels of a given system of ODEs. ### Method find_submodels ### Parameters - **ode** (ODE) - Required - The ODE system to be studied. ### Output Returns a list of submodels, each represented as an ODE object. ### Example ```julia >ode = @ODEmodel(x1'(t) = x1(t)^2, x2'(t) = x1(t) * x2(t), y1(t) = x1(t), y2(t) = x2(t)) >find_submodels(ode) ODE{QQMPolyRingElem}[ x1'(t) = a(t)*x2(t)^2 + x1(t) y1(t) = x1(t) ] ``` ``` -------------------------------- ### Assess model identifiability Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/reparametrization Check the identifiability of the defined SEUIR model states and parameters. ```julia assess_identifiability(ode) ``` ```text OrderedCollections.OrderedDict{Any, Symbol} with 9 entries: S(t) => :nonidentifiable E(t) => :nonidentifiable U(t) => :nonidentifiable I(t) => :globally N => :nonidentifiable a => :nonidentifiable b => :nonidentifiable d => :globally g => :globally ``` -------------------------------- ### Define ODE model with @ODEmodel macro Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/creating_ode Defines a mutualism ODE model using the @ODEmodel macro from StructuralIdentifiability.jl. The second block shows the expanded form of the equations as printed by the macro. ```julia using StructuralIdentifiability ode = @ODEmodel( x1'(t) = r1 * x1(t) * (1 - c1 * x1(t)) + beta1 * x1(t) * x2(t) / (chi1 + x2(t)) + u(t), x2'(t) = r2 * x2(t) * (1 - c2 * x2(t)) + beta2 * x1(t) * x2(t) / (chi2 + x1(t)), y(t) = x1(t) ) ``` ```text x1'(t) = (-x1(t)^2*x2(t)*c1*r1 - x1(t)^2*c1*chi1*r1 + x1(t)*x2(t)*beta1 + x1(t)*x2(t)*r1 + x1(t)*chi1*r1 + x2(t)*u(t) + u(t)*chi1)//(x2(t) + chi1) x2'(t) = (-x1(t)*x2(t)^2*c2*r2 + x1(t)*x2(t)*beta2 + x1(t)*x2(t)*r2 - x2(t)^2*c2*chi2*r2 + x2(t)*chi2*r2)//(x1(t) + chi2) y(t) = x1(t) ``` -------------------------------- ### assess_identifiability(ode; funcs_to_check, prob_threshold, loglevel) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/identifiability/identifiability Assesses identifiability of a given ODE model. Returns a dictionary mapping functions to their identifiability properties (:nonidentifiable, :locally, :globally). ```APIDOC ## assess_identifiability(ode; funcs_to_check, prob_threshold, loglevel) ### Description Assesses identifiability of a given ODE model. The result is guaranteed to be correct with probability at least prob_threshold. Returns an ordered dictionary from the functions to check to their identifiability properties (one of :nonidentifiable, :locally, :globally). ### Method Function call ### Endpoint assess_identifiability(ode; funcs_to_check = [], prob_threshold=0.99, loglevel=Logging.Info) ### Parameters #### Input Arguments - **ode** (ODE) - Required - The ODE model - **funcs_to_check** (list) - Optional - List of functions to check identifiability for; if empty, all parameters and states are taken - **known_ic** (list) - Optional - A list of functions whose initial conditions are assumed to be known; then the returned identifiable functions will be functions of parameters and initial conditions, not states (experimental) - **prob_threshold** (Float) - Optional - Probability of correctness (default: 0.99) - **loglevel** (LogLevel) - Optional - Minimal level of log messages to display (default: Logging.Info) ### Response #### Success Response Returns an ordered dictionary from the functions to check to their identifiability properties (one of :nonidentifiable, :locally, :globally). ``` -------------------------------- ### massive_eval(polys, eval_dict) Source: https://docs.sciml.ai/StructuralIdentifiability/stable/utils/wronskian Evaluates a list of polynomials at a point, assuming multiplications are relatively expensive. Precomputes all monomials and caches values of lower-degree monomials to compute higher-degree ones. ```APIDOC ## massive_eval(polys, eval_dict) ### Description Evaluates a list of polynomials at a point, assuming multiplications are relatively expensive. Precomputes all monomials and caches values of lower-degree monomials to compute higher-degree ones. ### Method Function call ### Endpoint `StructuralIdentifiability.massive_eval(polys, eval_dict)` ### Parameters - **polys** (list of polynomials) - Required - A list of polynomials to evaluate - **eval_dict** (dictionary) - Required - Dictionary from variables to values; missing values are treated as zeroes ### Response #### Success Response - **list of values** - The values of the polynomials at the given point #### Response Example ``` [value1, value2, ...] ``` ``` -------------------------------- ### Assess identifiability of ModelingToolkit model Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/creating_ode Assesses identifiability for the ModelingToolkit-based model, passing the measured quantities. The output shows the identifiability results for states and parameters. ```julia assess_identifiability(ode_mtk, measured_quantities = measured_quantities) ``` ```text OrderedCollections.OrderedDict{SymbolicUtils.BasicSymbolicImpl.var"typeof(BasicSymbolicImpl)"{SymbolicUtils.SymReal}, Symbol} with 10 entries: x1(t) => :globally x2(t) => :nonidentifiable beta1 => :globally chi1 => :nonidentifiable c1 => :globally r1 => :globally beta2 => :globally chi2 => :globally c2 => :nonidentifiable r2 => :globally ``` -------------------------------- ### Define the LLW1987 ODE model with @ODEmodel Source: https://docs.sciml.ai/StructuralIdentifiability/stable/tutorials/identifiable_functions Defines the LLW1987 model as a system of ODEs with three state variables and one output. This model is used throughout the page to demonstrate identifiability analysis. ```julia LLW1987 = @ODEmodel( x1'(t) = -p1 * x1(t) + p2 * u(t), x2'(t) = -p3 * x2(t) + p4 * u(t), x3'(t) = -(p1 + p3) * x3(t) + (p4 * x1(t) + p2 * x2(t)) * u(t), y1(t) = x3(t) ) ```