diff --git a/EpiAware/Project.toml b/EpiAware/Project.toml index 91561cb00..0b618be0d 100644 --- a/EpiAware/Project.toml +++ b/EpiAware/Project.toml @@ -17,6 +17,7 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" ManifoldDiff = "af67fdf4-a580-4b9f-bbec-742ef357defd" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Pathfinder = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" @@ -33,19 +34,20 @@ AdvancedHMC = "0.6" DataFramesMeta = "0.15" Distributions = "0.25" DocStringExtensions = "0.9" -DynamicPPL = "0.27, 0.28, 0.29, 0.30" +DynamicPPL = "0.30" FillArrays = "1.11" HybridArrays = "0.4.16" LinearAlgebra = ">= 1.9" LogExpFunctions = "0.3" MCMCChains = "6.0" ManifoldDiff = "0.3.10" -Pathfinder = "0.8" +OrdinaryDiffEq = "6.89.0" +Pathfinder = "0.9" QuadGK = "2.9" -Random = ">= 1.9" +Random = "1.11" Reexport = "1.2" -SparseArrays = "1.10" -Statistics = "1.10" +SparseArrays = "1.11" +Statistics = "1.11" Tables = "1.11" -Turing = "0.32, 0.33, 0.34" -julia = ">= 1.9" +Turing = "0.35" +julia = "1.11" diff --git a/EpiAware/src/EpiAwareUtils/prefix_submodel.jl b/EpiAware/src/EpiAwareUtils/prefix_submodel.jl index 85d95bd68..ccf85800d 100644 --- a/EpiAware/src/EpiAwareUtils/prefix_submodel.jl +++ b/EpiAware/src/EpiAwareUtils/prefix_submodel.jl @@ -20,7 +20,7 @@ submodel = prefix_submodel(FixedIntercept(0.1), generate_latent, string(1), 2) We can now draw a sample from the submodel. -```julia +```@example rand(submodel) ``` " diff --git a/EpiAware/src/EpiInfModels/EpiInfModels.jl b/EpiAware/src/EpiInfModels/EpiInfModels.jl index 22bc6498e..0c08a120e 100644 --- a/EpiAware/src/EpiInfModels/EpiInfModels.jl +++ b/EpiAware/src/EpiInfModels/EpiInfModels.jl @@ -6,10 +6,15 @@ module EpiInfModels using ..EpiAwareBase using ..EpiAwareUtils -using Turing, Distributions, DocStringExtensions, LinearAlgebra, LogExpFunctions +using LogExpFunctions: xexpy + +using Turing, Distributions, DocStringExtensions, LinearAlgebra, OrdinaryDiffEq + +#Export parameter helpers +export EpiData #Export models -export EpiData, DirectInfections, ExpGrowthRate, Renewal +export DirectInfections, ExpGrowthRate, Renewal, ODEProcess #Export functions export R_to_r, r_to_R, expected_Rt @@ -20,6 +25,7 @@ include("DirectInfections.jl") include("ExpGrowthRate.jl") include("RenewalSteps.jl") include("Renewal.jl") +include("ODEProcess.jl") include("utils.jl") end diff --git a/EpiAware/src/EpiInfModels/ODEProcess.jl b/EpiAware/src/EpiInfModels/ODEProcess.jl new file mode 100644 index 000000000..ab7cc6510 --- /dev/null +++ b/EpiAware/src/EpiInfModels/ODEProcess.jl @@ -0,0 +1,306 @@ +@doc raw""" +A structure representing an infection process modeled by an Ordinary Differential Equation (ODE). +At a high level, an `ODEProcess` struct object combines: + +- An `AbstractTuringParamModel` which defines the ODE model in terms of `OrdinaryDiffEq` types, + the parameters of the ODE model and a method to generate the parameters. +- A technique for solving and interpreting the ODE model using the `SciML` ecosystem. This includes + the solver used in the ODE solution, keyword arguments to send to the solver and a function + to map the `ODESolution` solution object to latent infections. + +# Constructors +- `ODEProcess(prob::ODEProblem; ts, solver, sol2infs)`: Create an `ODEProcess` +object with the ODE problem `prob`, time points `ts`, solver `solver`, and function `sol2infs`. + +# Predefined ODE models +Two basic ODE models are provided in the `EpiAware` package: `SIRParams` and `SEIRParams`. +In both cases these are defined in terms of the proportions of the population in each compartment +of the SIR and SEIR models respectively. + +## SIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dI}{dt} &= \beta SI - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `I` is the proportion of the +population that is infected and `R` is the proportion of the population that is recovered. The +parameters are the infectiousness `β` and the recovery rate `γ`. + +```jldoctest sirexample; output = false +using EpiAware, OrdinaryDiffEq, Distributions + +# Create an instance of SIRParams +sirparams = SIRParams( + tspan = (0.0, 100.0), + infectiousness = LogNormal(log(0.3), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) +nothing + +# output + +``` + +## SEIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dE}{dt} &= \beta SI - \alpha E \\ +\frac{dI}{dt} &= \alpha E - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `E` is the proportion of the +population that is exposed, `I` is the proportion of the population that is infected and `R` is +the proportion of the population that is recovered. The parameters are the infectiousness `β`, +the incubation rate `α` and the recovery rate `γ`. + +```jldoctest; output = false +using EpiAware, OrdinaryDiffEq, Distributions, Random +Random.seed!(1234) + +# Create an instance of SIRParams +seirparams = SEIRParams( + tspan = (0.0, 100.0), + infectiousness = LogNormal(log(0.3), 0.05), + incubation_rate = LogNormal(log(0.1), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) +nothing + +# output + +``` + +# Usage example with `ODEProcess` and predefined SIR model + +In this example we define an `ODEProcess` object using the predefined `SIRParams` model from +above. We then generate latent infections using the `generate_latent_infs` function, and refit +the model using a `Turing` model. + +We assume that the latent infections are observed with a Poisson likelihood around their +ODE model prediction. The population size is `N = 1000`, which we put into the `sol2infs` function, +which maps the ODE solution to the number of infections. Recall that the `EpiAware` default SIR +implementation assumes the model is in density/proportion form. Also, note that since the `sol2infs` +function is a link function that maps the ODE solution to the expected number of infections we also +apply the `LogExpFunctions.softplus` function to ensure that the expected number of infections is non-negative. +Note that the `softplus` function is a smooth approximation to the ReLU function `x -> max(0, x)`. +The utility of this approach is that small negative output from the ODE solver (e.g. ~ -1e-10) will be +mapped to small positive values, without needing to use strict positivity constraints in the model. + +First, we define the `ODEProcess` object which combines the SIR model with the `sol2infs` link +function and the solver options. + +```jldoctest sirexample; output = false +using Turing, LogExpFunctions +N = 1000.0 + +sir_process = ODEProcess( + params = sirparams, + sol2infs = sol -> softplus.(N .* sol[2, :]), + solver_options = Dict(:verbose => false, :saveat => 1.0) +) +nothing + +# output + +``` + +Second, we define a `PoissionError` observation model for linking the the number of infections. + +```jldoctest sirexample; output = false +pois_obs = PoissonError() +nothing + +# output + +``` + +Next, we create a `Turing` model for the full generative process: this solves the ODE model for +the latent infections and then samples the observed infections from a Poisson distribution with this +as the average. + +NB: The `nothing` argument is a dummy latent process, e.g. a log-Rt time series, that is not +used in the SIR model, but might be used in other models. + +```jldoctest sirexample; output = false +@model function fit_ode_model(data) + @submodel I_t = generate_latent_infs(sir_process, nothing) + @submodel y_t = generate_observations(pois_obs, data, I_t) + + return y_t +end +nothing + +# output + +``` + +We can generate some test data from the model by passing `missing` as the argument to the model. +This tells `Turing` that there is no data to condition on, so it will sample from the prior parameters +and then generate infections. In this case, we do it in a way where we cache the sampled parameters +as `θ` for later use. + +```jldoctest sirexample; output = false +# Sampled parameters +gen_mdl = fit_ode_model(missing) +θ = rand(gen_mdl) +test_data = (gen_mdl | θ)() +nothing + +# output + +``` + +Now, we can refit the model but this time we condition on the test data. We suppress the +output of the sampling process to keep the output clean, but you can remove the `@suppress` macro. + +```jldoctest sirexample; output = false +using Suppressor +inference_mdl = fit_ode_model(test_data) +chn = Suppressor.@suppress sample(inference_mdl, NUTS(), 2_000) +summarize(chn) +nothing + +# output + +``` + +We can compare the summarized chain to the sampled parameters in `θ` to see that the model is +fitting the data well and recovering a credible interval containing the true parameters. + +# Custom ODE models + +To define a custom ODE model, you need to define: + +- Some `CustomModel <: AbstractTuringLatentModel` struct + that contains the ODE problem as a field called `prob`, as well as sufficient fields to + define or sample the parameters of the ODE model. +- A method for `EpiAwareBase.generate_latent(params::CustomModel, Z_t)` that generates the + initial condition and parameters of the ODE model, potentially conditional on a sample from a latent process `Z_t`. + This method must return a `Tuple` `(u0, p)` where `u0` is the initial condition and `p` is the parameters. + +Here is an example of a simple custom ODE model for _specified_ exponential growth: + +```jldoctest customexample; output = false +using EpiAware, Turing, OrdinaryDiffEq +# Define a simple exponential growth model for testing +function expgrowth(du, u, p, t) + du[1] = p[1] * u[1] +end + +r = log(2) / 7 # Growth rate corresponding to 7 day doubling time + +# Define the ODE problem using SciML +prob = ODEProblem(expgrowth, [1.0], (0.0, 10.0), [r]) + +# Define the custom parameters struct +struct CustomModel <: AbstractTuringLatentModel + prob::ODEProblem + r::Float64 + u0::Float64 +end +custom_ode = CustomModel(prob, r, 1.0) + +# Define the custom generate_latent function +@model function EpiAwareBase.generate_latent(params::CustomModel, n) + return ([params.u0], [params.r]) +end +nothing + +# output + +``` + +This model is not random! But we can still use it to generate latent infections. + +```jldoctest customexample; output = false +# Define the ODEProcess +expgrowth_model = ODEProcess( + params = custom_ode, + sol2infs = sol -> sol[1, :] +) +infs = generate_latent_infs(expgrowth_model, nothing)() +nothing + +# output + +``` +""" +@kwdef struct ODEProcess{ + P <: AbstractTuringLatentModel, S, F <: Function, D <: + Union{Dict, NamedTuple}} <: + EpiAwareBase.AbstractTuringEpiModel + "The ODE problem and parameters, where `P` is a subtype of `AbstractTuringLatentModel`." + params::P + "The solver used for the ODE problem. Default is `AutoVern7(Rodas5())`, which is an auto + switching solver aimed at medium/low tolerances." + solver::S = AutoVern7(Rodas5()) + "A function that maps the solution object of the ODE to infection counts." + sol2infs::F + "The extra solver options for the ODE problem. Can be either a `Dict` or a `NamedTuple` + containing the solver options." + solver_options::D = Dict(:verbose => false, :saveat => 1.0) +end + +@doc raw""" +Implement the `generate_latent_infs` function for the `ODEProcess` model. + +This function remakes the ODE problem with the provided initial conditions and parameters, + solves it using the specified solver, and then transforms the solution into latent infections + using the `sol2infs` function. + +# Example usage with predefined SIR model + +In this example we define an `ODEProcess` object using the predefined `SIRParams` model and +generate an expected infection time series using SIR model parameters sampled from their priors. + +```jldoctest; output = false +using EpiAware, OrdinaryDiffEq, Distributions, Turing, LogExpFunctions + +# Create an instance of SIRParams +sirparams = SIRParams( + tspan = (0.0, 100.0), + infectiousness = LogNormal(log(0.3), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) + +#Population size + +N = 1000.0 + +sir_process = ODEProcess( + params = sirparams, + sol2infs = sol -> softplus.(N .* sol[2, :]), + solver_options = Dict(:verbose => false, :saveat => 1.0) +) + +generated_It = generate_latent_infs(sir_process, nothing)() +nothing + +# output + +``` + +""" +@model function EpiAwareBase.generate_latent_infs(epi_model::ODEProcess, Z_t) + prob, solver, sol2infs, solver_options = epi_model.params.prob, + epi_model.solver, epi_model.sol2infs, epi_model.solver_options + n = isnothing(Z_t) ? 0 : size(Z_t, 1) + + @submodel u0, p = generate_latent(epi_model.params, n) + + _prob = remake(prob; u0 = u0, p = p) + sol = solve(_prob, solver; solver_options...) + I_t = sol2infs(sol) + + return I_t +end diff --git a/EpiAware/src/EpiLatentModels/EpiLatentModels.jl b/EpiAware/src/EpiLatentModels/EpiLatentModels.jl index fc069cf10..096ef77dd 100644 --- a/EpiAware/src/EpiLatentModels/EpiLatentModels.jl +++ b/EpiAware/src/EpiLatentModels/EpiLatentModels.jl @@ -11,11 +11,15 @@ using LogExpFunctions: softmax using FillArrays: Fill -using Turing, Distributions, DocStringExtensions, LinearAlgebra +using Turing, Distributions, DocStringExtensions, LinearAlgebra, SparseArrays, + OrdinaryDiffEq #Export models export FixedIntercept, Intercept, IID, RandomWalk, AR, MA, HierarchicalNormal +#Export ODE definitions +export SIRParams, SEIRParams + # Export tools for manipulating latent models export CombineLatentModels, ConcatLatentModels, BroadcastLatentModel @@ -32,12 +36,15 @@ export DiffLatentModel, TransformLatentModel, PrefixLatentModel, RecordExpectedL export define_arma, define_arima include("docstrings.jl") +include("utils.jl") include("models/Intercept.jl") include("models/IID.jl") include("models/RandomWalk.jl") include("models/AR.jl") include("models/MA.jl") include("models/HierarchicalNormal.jl") +include("odemodels/SIRParams.jl") +include("odemodels/SEIRParams.jl") include("modifiers/DiffLatentModel.jl") include("modifiers/TransformLatentModel.jl") include("modifiers/PrefixLatentModel.jl") diff --git a/EpiAware/src/EpiLatentModels/odemodels/SEIRParams.jl b/EpiAware/src/EpiLatentModels/odemodels/SEIRParams.jl new file mode 100644 index 000000000..3a5f2ac7b --- /dev/null +++ b/EpiAware/src/EpiLatentModels/odemodels/SEIRParams.jl @@ -0,0 +1,183 @@ +@doc raw""" +Internal function for the vector field of a basic SEIR model written in density/per-capita +form. The function is used to define the ODE problem for the SIR model. +""" +function _seir_vf(du, u, p, t) + S, E, I, R = u + β, α, γ = p + du[1] = -β * S * I + du[2] = β * S * I - α * E + du[3] = α * E - γ * I + du[4] = γ * I + return nothing +end + +@doc raw""" +Sparse Jacobian matrix prototype for the basic SEIR model written in density/per-capita form. +""" +const _seir_jac_prototype = sparse([1.0 0.0 1.0 0.0; + 1.0 1.0 1.0 0.0; + 0.0 1.0 1.0 0.0; + 0.0 0.0 1.0 0.0]) + +@doc raw""" +Internal function for the Jacobian of the basic SEIR model written in density/per-capita +form. The function is used to define the ODE problem for the SEIR model. The Jacobian +is used to speed up the solution of the ODE problem when using a stiff solver. +""" +function _seir_jac(J, u, p, t) + S, E, I, R = u + β, α, γ = p + J[1, 1] = -β * I + J[1, 3] = -β * S + J[2, 1] = β * I + J[2, 2] = -α + J[2, 3] = β * S + J[3, 2] = α + J[3, 3] = -γ + J[4, 3] = γ + nothing +end + +@doc raw""" +Internal function for the ODE function of the basic SIR model written in density/per-capita +form. The function passes vector field and Jacobian functions to the ODE solver. +""" +_seir_function = ODEFunction(_seir_vf; jac = _seir_jac) + +@doc raw""" +A structure representing the SEIR (Susceptible-Exposed-Infectious-Recovered) model and priors for the +infectiousness and recovery rate parameters. + +# Constructors +- `SEIRParams(; tspan, infectiousness::Distribution, incubation_rate::Distribution, + recovery_rate::Distribution, initial_prop_infected::Distribution)` : +Construct a `SEIRParams` object with the specified time span for ODE solving, infectiousness +prior, incubation rate prior and recovery rate prior. + +## SEIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dE}{dt} &= \beta SI - \alpha E \\ +\frac{dI}{dt} &= \alpha E - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `E` is the proportion of the +population that is exposed, `I` is the proportion of the population that is infected and `R` is +the proportion of the population that is recovered. The parameters are the infectiousness `β`, +the incubation rate `α` and the recovery rate `γ`. + +```jldoctest; output = false +using EpiAware, OrdinaryDiffEq, Distributions + +# Create an instance of SIRParams +seirparams = SEIRParams( + tspan = (0.0, 30.0), + infectiousness = LogNormal(log(0.3), 0.05), + incubation_rate = LogNormal(log(0.1), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) +nothing + +# output + +``` +""" +struct SEIRParams{ + P <: ODEProblem, D <: Sampleable, E <: Sampleable, F <: Sampleable, G <: Sampleable} <: + AbstractTuringLatentModel + "The ODE problem instance for the SIR model." + prob::P + "Prior distribution for the infectiousness parameter." + infectiousness::D + "Prior distribution for the incubation rate parameter." + incubation_rate::E + "Prior distribution for the recovery rate parameter." + recovery_rate::F + "Prior distribution for initial proportion of the population that is infected." + initial_prop_infected::G +end + +function SEIRParams(; + tspan, infectiousness::Distribution, incubation_rate::Distribution, + recovery_rate::Distribution, initial_prop_infected::Distribution) + seir_prob = ODEProblem(_seir_function, [0.99, 0.05, 0.05, 0.0], tspan) + return SEIRParams{ + typeof(seir_prob), typeof(infectiousness), typeof(incubation_rate), + typeof(recovery_rate), typeof(initial_prop_infected)}( + seir_prob, infectiousness, incubation_rate, + recovery_rate, initial_prop_infected) +end + +@doc raw""" +Generates the initial parameters and initial conditions for the basic SEIR model. + +## SEIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dE}{dt} &= \beta SI - \alpha E \\ +\frac{dI}{dt} &= \alpha E - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `E` is the proportion of the +population that is exposed, `I` is the proportion of the population that is infected and `R` is +the proportion of the population that is recovered. The parameters are the infectiousness `β`, +the incubation rate `α` and the recovery rate `γ`. + +## Initial conditions + +For this version of the SEIR model we sample the initial proportion of the population that is +_infected_ (exposed or infectious). The proportion of the infected group that is exposed is +`α / (α + γ)` and the proportion of the infected group that is infectious is `γ / (α + γ)`. The +reason for this is that these are the equilibrium proportions in a constant incidence environment. + +# Example + +```jldoctest; output = false +using EpiAware, OrdinaryDiffEq, Distributions + +# Create an instance of SIRParams +seirparams = SEIRParams( + tspan = (0.0, 30.0), + infectiousness = LogNormal(log(0.3), 0.05), + incubation_rate = LogNormal(log(0.1), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) + +seirparam_mdl = generate_latent(seirparams, nothing) + +# Sample the parameters of SEIR model +sampled_params = rand(seirparam_mdl) +nothing + +# output + +``` + +# Returns + A tuple `(u0, p)` where: + - `u0`: A vector representing the initial state of the system `[S₀, E₀, I₀, R₀]` where `S₀` + is the initial proportion of susceptible individuals, `E₀` is the initial proportion of exposed + individuals,`I₀` is the initial proportion of infected individuals, and `R₀` is the initial + proportion of recovered individuals. + - `p`: A vector containing the parameters `[β, α, γ]` where `β` is the infectiousness rate, + `α` is the incubation rate, and `γ` is the recovery rate. +""" +@model function EpiAwareBase.generate_latent(params::SEIRParams, n) + β ~ params.infectiousness + α ~ params.incubation_rate + γ ~ params.recovery_rate + initial_infs ~ params.initial_prop_infected + + u0 = [1.0 - initial_infs, initial_infs * γ / (α + γ), initial_infs * α / (α + γ), 0.0] + p = [β, α, γ] + return (u0, p) +end diff --git a/EpiAware/src/EpiLatentModels/odemodels/SIRParams.jl b/EpiAware/src/EpiLatentModels/odemodels/SIRParams.jl new file mode 100644 index 000000000..e13c4aaa5 --- /dev/null +++ b/EpiAware/src/EpiLatentModels/odemodels/SIRParams.jl @@ -0,0 +1,158 @@ +@doc raw""" +Internal function for the vector field of a basic SIR model written in density/per-capita +form. The function is used to define the ODE problem for the SIR model. +""" +function _sir_vf(du, u, p, t) + S, I, R = u + β, γ = p + du[1] = -β * S * I + du[2] = β * S * I - γ * I + du[3] = γ * I + return nothing +end + +@doc raw""" +Sparse Jacobian matrix prototype for the basic SIR model written in density/per-capita form. +""" +const _sir_jac_prototype = sparse([1.0 1.0 0.0; + 1.0 1.0 0.0; + 0.0 1.0 0.0]) + +@doc raw""" +Internal function for the Jacobian of the basic SIR model written in density/per-capita +form. The function is used to define the ODE problem for the SIR model. The Jacobian +is used to speed up the solution of the ODE problem when using a stiff solver. +""" +function _sir_jac(J, u, p, t) + S, I, R = u + β, γ = p + J[1, 1] = -β * I + J[1, 2] = -β * S + J[2, 1] = β * I + J[2, 2] = β * S - γ + J[3, 2] = γ + nothing +end + +@doc raw""" +Internal function for the ODE function of the basic SIR model written in density/per-capita +form. The function passes vector field and Jacobian functions to the ODE solver. +""" +_sir_function = ODEFunction(_sir_vf; jac = _sir_jac) + +@doc raw""" +A structure representing the SIR (Susceptible-Infectious-Recovered) model and priors for the +infectiousness and recovery rate parameters. + +# Constructors +- `SIRParams(; tspan, + infectiousness::Distribution, + recovery_rate::Distribution, + initial_prop_infected::Distribution)` : +Construct an `SIRParams` object with the specified time span for ODE solving, infectiousness +prior, and recovery rate prior. + +## SIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dI}{dt} &= \beta SI - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `I` is the proportion of the +population that is infected and `R` is the proportion of the population that is recovered. The +parameters are the infectiousness `β` and the recovery rate `γ`. + +# Example + +```jldoctest; output = false + using EpiAware, OrdinaryDiffEq, Distributions + +# Create an instance of SIRParams +sirparams = SIRParams( + tspan = (0.0, 30.0), + infectiousness = LogNormal(log(0.3), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) +nothing + +# output + +``` +""" +struct SIRParams{P <: ODEProblem, D <: Sampleable, E <: Sampleable, F <: Sampleable} <: + AbstractTuringLatentModel + "The ODE problem instance for the SIR model." + prob::P + "Prior distribution for the infectiousness parameter." + infectiousness::D + "Prior distribution for the recovery rate parameter." + recovery_rate::E + "Prior distribution for initial proportion of the population that is infected." + initial_prop_infected::F +end + +function SIRParams(; + tspan, infectiousness::Distribution, recovery_rate::Distribution, + initial_prop_infected::Distribution) + sir_prob = ODEProblem(_sir_function, [0.99, 0.01, 0.0], tspan) + return SIRParams{typeof(sir_prob), typeof(infectiousness), + typeof(recovery_rate), typeof(initial_prop_infected)}( + sir_prob, infectiousness, recovery_rate, initial_prop_infected) +end + +@doc raw""" +Generates the initial parameters and initial conditions for the basic SIR model. + +## SIR model + +```math +\begin{aligned} +\frac{dS}{dt} &= -\beta SI \\ +\frac{dI}{dt} &= \beta SI - \gamma I \\ +\frac{dR}{dt} &= \gamma I +\end{aligned} +``` +Where `S` is the proportion of the population that is susceptible, `I` is the proportion of the +population that is infected and `R` is the proportion of the population that is recovered. The +parameters are the infectiousness `β` and the recovery rate `γ`. + +# Example + +```jldoctest; output = false +using EpiAware, OrdinaryDiffEq, Distributions + +# Create an instance of SIRParams +sirparams = SIRParams( + tspan = (0.0, 30.0), + infectiousness = LogNormal(log(0.3), 0.05), + recovery_rate = LogNormal(log(0.1), 0.05), + initial_prop_infected = Beta(1, 99) +) + +sirparam_mdl = generate_latent(sirparams, nothing) + +#sample the parameters of SIR model +sampled_params = rand(sirparam_mdl) +nothing + +# output + +``` + +# Returns +- A tuple `(u0, p)` where: + - `u0`: A vector representing the initial state of the system `[S₀, I₀, R₀]` where `S₀` is the initial proportion of susceptible individuals, `I₀` is the initial proportion of infected individuals, and `R₀` is the initial proportion of recovered individuals. + - `p`: A vector containing the parameters `[β, γ]` where `β` is the infectiousness rate and `γ` is the recovery rate. +""" +@model function EpiAwareBase.generate_latent(params::SIRParams, n) + β ~ params.infectiousness + γ ~ params.recovery_rate + I₀ ~ params.initial_prop_infected + u0 = [1.0 - I₀, I₀, 0.0] + p = [β, γ] + return (u0, p) +end diff --git a/EpiAware/src/EpiLatentModels/utils.jl b/EpiAware/src/EpiLatentModels/utils.jl index c4f1558ce..e0f882ca8 100644 --- a/EpiAware/src/EpiLatentModels/utils.jl +++ b/EpiAware/src/EpiLatentModels/utils.jl @@ -1,3 +1,10 @@ +""" +Internal function to expand a vector of distributions into a product distribution. + +## Implementation note +If all distributions in the input vector `dist` are the same, it returns a filled distribution using `filldist`. +Otherwise, it returns an array distribution using `arraydist`. +""" function _expand_dist(dist::Vector{D} where {D <: Distribution}) d = length(dist) product_dist = all(first(dist) .== dist) ? diff --git a/EpiAware/test/EpiInfModels/ODEProcess.jl b/EpiAware/test/EpiInfModels/ODEProcess.jl new file mode 100644 index 000000000..24818bf7d --- /dev/null +++ b/EpiAware/test/EpiInfModels/ODEProcess.jl @@ -0,0 +1,150 @@ +@testitem "ODEProcess for SIR model constructor + `generate_latent_infs` tests" begin + using OrdinaryDiffEq, Distributions + # Define the time span for the ODE problem + tspan = (0.0, 30.0) + + # Define prior distributions + infectiousness = LogNormal(log(0.3), 0.05) + recovery_rate = LogNormal(log(0.1), 0.05) + initial_prop_infected = Beta(1, 99) + + # Create an instance of SIRParams + sirparams = SIRParams( + tspan = tspan, + infectiousness = infectiousness, + recovery_rate = recovery_rate, + initial_prop_infected = initial_prop_infected + ) + + # Define the SIR ODEProcess model + # using solver_options as a Dict + sir_process = ODEProcess( + params = sirparams, + sol2infs = sol -> sol[2, :], + solver_options = Dict(:verbose => false, :saveat => 1.0, :reltol => 1e-10) + ) + # Define the SIR ODEProcess model + # using solver_options as a NamedTuple + sir_process2 = ODEProcess( + params = sirparams, + sol2infs = sol -> sol[2, :], + solver_options = (verbose = false, saveat = 1.0, reltol = 1e-10) + ) + @testset "Constructor tests" begin + # Check the types of the fields + @test sir_process.params isa SIRParams + @test sir_process.sol2infs isa Function + @test sir_process.solver_options isa Dict + @test sir_process2.solver_options isa NamedTuple + end + + @testset "generate_latent_infs tests equal with both solver_options" begin + Z_t = rand(10) # dummy latent process + inf_mdl = generate_latent_infs(sir_process, Z_t) + inf_mdl2 = generate_latent_infs(sir_process2, Z_t) + θ = rand(inf_mdl) + θ2 = rand(inf_mdl2) + @test keys(θ) == keys(θ2) + It = (inf_mdl | θ)() + It2 = (inf_mdl2 | θ)() + + @test It ≈ It2 + end +end + +@testitem "ODEProcess for SEIR model constructor + `generate_latent_infs` tests" begin + using OrdinaryDiffEq, Distributions + # Define the time span for the ODE problem + tspan = (0.0, 30.0) + + # Define prior distributions + infectiousness = LogNormal(log(0.3), 0.05) + incubation_rate = LogNormal(log(0.1), 0.05) + recovery_rate = LogNormal(log(0.1), 0.05) + initial_prop_infected = Beta(1, 99) + + # Create an instance of SIRParams + seirparams = SEIRParams( + tspan = tspan, + infectiousness = infectiousness, + incubation_rate = incubation_rate, + recovery_rate = recovery_rate, + initial_prop_infected = initial_prop_infected + ) + + # Define the SIR ODEProcess model + # using solver_options as a Dict + seir_process = ODEProcess( + params = seirparams, + sol2infs = sol -> sol[2, :], + solver_options = Dict(:verbose => false, :saveat => 1.0, :reltol => 1e-10) + ) + # Define the SIR ODEProcess model + # using solver_options as a NamedTuple + seir_process2 = ODEProcess( + params = seirparams, + sol2infs = sol -> sol[2, :], + solver_options = (verbose = false, saveat = 1.0, reltol = 1e-10) + ) + @testset "Constructor tests" begin + # Check the types of the fields + @test seir_process.params isa SEIRParams + @test seir_process.sol2infs isa Function + @test seir_process.solver_options isa Dict + @test seir_process2.solver_options isa NamedTuple + end + + @testset "generate_latent_infs tests equal with both solver_options" begin + Z_t = rand(10) # dummy latent process + inf_mdl = generate_latent_infs(seir_process, Z_t) + inf_mdl2 = generate_latent_infs(seir_process2, Z_t) + θ = rand(inf_mdl) + θ2 = rand(inf_mdl2) + @test keys(θ) == keys(θ2) + It = (inf_mdl | θ)() + It2 = (inf_mdl2 | θ)() + + @test It ≈ It2 + end +end + +@testitem "Custom ODE model" begin + using OrdinaryDiffEq, Distributions, Turing + + # Define a simple exponential growth model for testing + function expgrowth(du, u, p, t) + du[1] = p[1] * u[1] + end + + r = log(2) / 7 # Growth rate corresponding to 7 day doubling time + + # Define the ODE problem using SciML + prob = ODEProblem(expgrowth, [1.0], (0.0, 10.0), [r]) + + # Define the custom parameters struct + struct CustomParams <: AbstractTuringLatentModel + prob::ODEProblem + r::Float64 + u0::Float64 + end + params = CustomParams(prob, r, 1.0) + + # Define the custom generate_latent function + @model function EpiAwareBase.generate_latent(params::CustomParams, Z_t) + return ([params.u0], [params.r]) + end + + # Define the ODEProcess + expgrowth_model = ODEProcess( + params = params, + sol2infs = sol -> sol[1, :] + ) + + # Generate the latent infections + Z_t = rand(10) # dummy latent process + inf_mdl = generate_latent_infs(expgrowth_model, Z_t) + @test rand(inf_mdl) == NamedTuple() + I_t = inf_mdl() + @test length(I_t) == 11 + @test I_t ≈ [exp(r * t) for t in 0:10] +end diff --git a/EpiAware/test/EpiLatentModels/odemodels/SEIRParams.jl b/EpiAware/test/EpiLatentModels/odemodels/SEIRParams.jl new file mode 100644 index 000000000..b3803d116 --- /dev/null +++ b/EpiAware/test/EpiLatentModels/odemodels/SEIRParams.jl @@ -0,0 +1,60 @@ +@testitem "SEIRParams: constructor and `generate_latent`" begin + using OrdinaryDiffEq, Distributions + # Define the time span for the ODE problem + tspan = (0.0, 10.0) + + # Define prior distributions + infectiousness = LogNormal(log(0.3), 0.05) + incubation_rate = LogNormal(log(0.1), 0.05) + recovery_rate = LogNormal(log(0.1), 0.05) + initial_prop_infected = Beta(2, 5) + + # Create an instance of seirparams + seirparams = SEIRParams( + tspan = tspan, + infectiousness = infectiousness, + incubation_rate = incubation_rate, + recovery_rate = recovery_rate, + initial_prop_infected = initial_prop_infected + ) + + @testset "SEIRParams constructor tests" begin + # Check the types of the fields + @test seirparams.prob isa ODEProblem + @test seirparams.infectiousness isa Distribution + @test seirparams.incubation_rate isa Distribution + @test seirparams.recovery_rate isa Distribution + @test seirparams.initial_prop_infected isa Distribution + + # Check the values of the fields + @test seirparams.prob.tspan == tspan + @test seirparams.infectiousness == infectiousness + @test seirparams.incubation_rate == incubation_rate + @test seirparams.recovery_rate == recovery_rate + @test seirparams.initial_prop_infected == initial_prop_infected + end + + @testset "SEIRParams `generate_latent` tests" begin + # Generate parameters + Z_t = rand(10) # dummy latent process + seirparam_mdl = generate_latent(seirparams, Z_t) + sampled_params = rand(seirparam_mdl) + + # Check the types of the fields + @test sampled_params.β isa Float64 + @test sampled_params.α isa Float64 + @test sampled_params.γ isa Float64 + @test sampled_params.initial_infs isa Float64 + end +end + +@testitem "SEIRParams: jac_prototype non-zeros invariant to jac call" begin + Jp = deepcopy(EpiAware.EpiLatentModels._seir_jac_prototype) + Jp_pattern_before = Jp .!= 0 + u = rand(4) + p = rand(3) + EpiAware.EpiLatentModels._seir_jac(Jp, u, p, 0.0) + Jp_pattern_after = Jp .!= 0 + + @test Jp_pattern_before == Jp_pattern_after +end diff --git a/EpiAware/test/EpiLatentModels/odemodels/SIRParams.jl b/EpiAware/test/EpiLatentModels/odemodels/SIRParams.jl new file mode 100644 index 000000000..000c86366 --- /dev/null +++ b/EpiAware/test/EpiLatentModels/odemodels/SIRParams.jl @@ -0,0 +1,55 @@ +@testitem "SIRParams: constructor and `generate_latent`" begin + using OrdinaryDiffEq, Distributions + # Define the time span for the ODE problem + tspan = (0.0, 10.0) + + # Define prior distributions + infectiousness = LogNormal(log(0.3), 0.05) + recovery_rate = LogNormal(log(0.1), 0.05) + initial_prop_infected = Beta(2, 5) + + # Create an instance of SIRParams + sirparams = SIRParams( + tspan = tspan, + infectiousness = infectiousness, + recovery_rate = recovery_rate, + initial_prop_infected = initial_prop_infected + ) + + @testset "SIRParams constructor tests" begin + # Check the types of the fields + @test sirparams.prob isa ODEProblem + @test sirparams.infectiousness isa Distribution + @test sirparams.recovery_rate isa Distribution + @test sirparams.initial_prop_infected isa Distribution + + # Check the values of the fields + @test sirparams.prob.tspan == tspan + @test sirparams.infectiousness == infectiousness + @test sirparams.recovery_rate == recovery_rate + @test sirparams.initial_prop_infected == initial_prop_infected + end + + @testset "SIRParams `generate_latent` tests" begin + # Generate parameters + Z_t = rand(10) # dummy latent process + sirparam_mdl = generate_latent(sirparams, Z_t) + sampled_params = rand(sirparam_mdl) + + # Check the types of the fields + @test sampled_params.β isa Float64 + @test sampled_params.γ isa Float64 + @test sampled_params.I₀ isa Float64 + end +end + +@testitem "SIRParams: jac_prototype non-zeros invariant to jac call" begin + Jp = deepcopy(EpiAware.EpiLatentModels._sir_jac_prototype) + Jp_pattern_before = Jp .!= 0 + u = rand(3) + p = rand(2) + EpiAware.EpiLatentModels._sir_jac(Jp, u, p, 0.0) + Jp_pattern_after = Jp .!= 0 + + @test Jp_pattern_before == Jp_pattern_after +end diff --git a/EpiAware/test/EpiObsModels/modifiers/ascertainment/helpers.jl b/EpiAware/test/EpiObsModels/modifiers/ascertainment/helpers.jl index bcf7ce20e..881fd1fae 100644 --- a/EpiAware/test/EpiObsModels/modifiers/ascertainment/helpers.jl +++ b/EpiAware/test/EpiObsModels/modifiers/ascertainment/helpers.jl @@ -5,7 +5,8 @@ model::AbstractTuringObservationModel end - @model EpiAware.EpiAwareBase.generate_observations(model::ExpectedObs, y_t, Y_t) = begin + @model EpiAware.EpiAwareBase.generate_observations(model::ExpectedObs, y_t, + Y_t) = begin expected_obs := Y_t @submodel y_t = generate_observations(model.model, y_t, Y_t) end diff --git a/EpiAware/test/Project.toml b/EpiAware/test/Project.toml index 158597502..b9cb60592 100644 --- a/EpiAware/test/Project.toml +++ b/EpiAware/test/Project.toml @@ -15,6 +15,7 @@ LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c" LogDensityProblemsAD = "996a588d-648d-4e1f-a8f0-a84b347e47b1" LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688" MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" Pathfinder = "b1d3bc72-d0e7-4279-b92f-7fa5d6d2d454" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" diff --git a/benchmark/Manifest.toml b/benchmark/Manifest.toml index 52ceb22ef..451bcb15d 100644 --- a/benchmark/Manifest.toml +++ b/benchmark/Manifest.toml @@ -5,18 +5,16 @@ manifest_format = "2.0" project_hash = "9fb2e9db0221fb4b8d0c098c0ecdd8e5e0675214" [[deps.ADTypes]] -git-tree-sha1 = "eea5d80188827b35333801ef97a40c2ed653b081" +git-tree-sha1 = "30bb95a372787af850addf28ac937f1be7b79173" uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" -version = "1.9.0" +version = "1.10.0" +weakdeps = ["ChainRulesCore", "ConstructionBase", "EnzymeCore"] [deps.ADTypes.extensions] ADTypesChainRulesCoreExt = "ChainRulesCore" + ADTypesConstructionBaseExt = "ConstructionBase" ADTypesEnzymeCoreExt = "EnzymeCore" - [deps.ADTypes.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] git-tree-sha1 = "d92ad398961a3ed262d8bf04a1a2b8340f915fef" @@ -82,9 +80,9 @@ weakdeps = ["StaticArrays"] [[deps.AdvancedHMC]] deps = ["AbstractMCMC", "ArgCheck", "DocStringExtensions", "InplaceOps", "LinearAlgebra", "LogDensityProblems", "LogDensityProblemsAD", "ProgressMeter", "Random", "Requires", "Setfield", "SimpleUnPack", "Statistics", "StatsBase", "StatsFuns"] -git-tree-sha1 = "eae78b1632ddc90dabbf72c23547ad5418be5ce5" +git-tree-sha1 = "6f6a228808fe00ad05b47d74747c800d3df18acb" uuid = "0bf59076-c3b1-5ca4-86bd-e02cd72cde3d" -version = "0.6.3" +version = "0.6.4" [deps.AdvancedHMC.extensions] AdvancedHMCCUDAExt = "CUDA" @@ -189,6 +187,16 @@ version = "7.17.0" StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" +[[deps.ArrayLayouts]] +deps = ["FillArrays", "LinearAlgebra"] +git-tree-sha1 = "492681bc44fac86804706ddb37da10880a2bd528" +uuid = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" +version = "1.10.4" +weakdeps = ["SparseArrays"] + + [deps.ArrayLayouts.extensions] + ArrayLayoutsSparseArraysExt = "SparseArrays" + [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" version = "1.11.0" @@ -292,11 +300,23 @@ git-tree-sha1 = "0691e34b3bb8be9307330f88d1a3c3f25466c24d" uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" version = "0.1.9" +[[deps.BitTwiddlingConvenienceFunctions]] +deps = ["Static"] +git-tree-sha1 = "f21cfd4950cb9f0587d5067e69405ad2acd27b87" +uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b" +version = "0.1.6" + [[deps.CEnum]] git-tree-sha1 = "389ad5c84de1ae7cf0e28e381131c98ea87d54fc" uuid = "fa961155-64e5-5f13-b03f-caf6b980ea82" version = "0.5.0" +[[deps.CPUSummary]] +deps = ["CpuId", "IfElse", "PrecompileTools", "Static"] +git-tree-sha1 = "5a97e67919535d6841172016c9530fd69494e5ec" +uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9" +version = "0.2.6" + [[deps.Chain]] git-tree-sha1 = "9ae9be75ad8ad9d26395bf625dea9beac6d519f1" uuid = "8be319e6-bccf-4806-a6f7-6fae938471bc" @@ -329,6 +349,12 @@ weakdeps = ["InverseFunctions", "Test"] ChangesOfVariablesInverseFunctionsExt = "InverseFunctions" ChangesOfVariablesTestExt = "Test" +[[deps.CloseOpenIntervals]] +deps = ["Static", "StaticArrayInterface"] +git-tree-sha1 = "05ba0d07cd4fd8b7a39541e31a7b0254704ea581" +uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9" +version = "0.1.13" + [[deps.CodecZlib]] deps = ["TranscodingStreams", "Zlib_jll"] git-tree-sha1 = "bce6804e5e6044c6daab27bb533d1295e4a2e759" @@ -385,6 +411,11 @@ weakdeps = ["InverseFunctions"] [deps.CompositionsBase.extensions] CompositionsBaseInverseFunctionsExt = "InverseFunctions" +[[deps.ConcreteStructs]] +git-tree-sha1 = "f749037478283d372048690eb3b5f92a79432b34" +uuid = "2569d6c7-a4a2-43d3-a901-331e8e4be471" +version = "0.2.3" + [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] git-tree-sha1 = "ea32b83ca4fefa1768dc84e504cc0a94fb1ab8d1" @@ -481,6 +512,40 @@ git-tree-sha1 = "61ab242274c0d44412d8eab38942a49aa46de9d0" uuid = "85a47980-9c8c-11e8-2b9f-f7ca1fa99fb4" version = "0.4.3" +[[deps.DiffEqBase]] +deps = ["ArrayInterface", "ConcreteStructs", "DataStructures", "DocStringExtensions", "EnumX", "EnzymeCore", "FastBroadcast", "FastClosures", "FastPower", "ForwardDiff", "FunctionWrappers", "FunctionWrappersWrappers", "LinearAlgebra", "Logging", "Markdown", "MuladdMacro", "Parameters", "PreallocationTools", "PrecompileTools", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "Setfield", "Static", "StaticArraysCore", "Statistics", "TruncatedStacktraces"] +git-tree-sha1 = "b7dbeaa770bad0980ddddf606de814cff2acb3bc" +uuid = "2b5f629d-d688-5b77-993f-72d75c75574e" +version = "6.160.0" + + [deps.DiffEqBase.extensions] + DiffEqBaseCUDAExt = "CUDA" + DiffEqBaseChainRulesCoreExt = "ChainRulesCore" + DiffEqBaseDistributionsExt = "Distributions" + DiffEqBaseEnzymeExt = ["ChainRulesCore", "Enzyme"] + DiffEqBaseGeneralizedGeneratedExt = "GeneralizedGenerated" + DiffEqBaseMPIExt = "MPI" + DiffEqBaseMeasurementsExt = "Measurements" + DiffEqBaseMonteCarloMeasurementsExt = "MonteCarloMeasurements" + DiffEqBaseReverseDiffExt = "ReverseDiff" + DiffEqBaseSparseArraysExt = "SparseArrays" + DiffEqBaseTrackerExt = "Tracker" + DiffEqBaseUnitfulExt = "Unitful" + + [deps.DiffEqBase.weakdeps] + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + GeneralizedGenerated = "6b9d7cbe-bcb9-11e9-073f-15a7a543e2eb" + MPI = "da04e1cc-30fd-572f-bb4f-1f8673147195" + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + [[deps.DiffResults]] deps = ["StaticArraysCore"] git-tree-sha1 = "782dd5f4561f5d267313f23853baaaa4c52ea621" @@ -493,6 +558,48 @@ git-tree-sha1 = "23163d55f885173722d1e4cf0f6110cdbaf7e272" uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" version = "1.15.1" +[[deps.DifferentiationInterface]] +deps = ["ADTypes", "LinearAlgebra"] +git-tree-sha1 = "0c99576d0b93df0aff1bed9d9adddef14e4e658f" +uuid = "a0c0ee7d-e4b9-4e03-894e-1c5f64a51d63" +version = "0.6.22" + + [deps.DifferentiationInterface.extensions] + DifferentiationInterfaceChainRulesCoreExt = "ChainRulesCore" + DifferentiationInterfaceDiffractorExt = "Diffractor" + DifferentiationInterfaceEnzymeExt = "Enzyme" + DifferentiationInterfaceFastDifferentiationExt = "FastDifferentiation" + DifferentiationInterfaceFiniteDiffExt = "FiniteDiff" + DifferentiationInterfaceFiniteDifferencesExt = "FiniteDifferences" + DifferentiationInterfaceForwardDiffExt = "ForwardDiff" + DifferentiationInterfaceMooncakeExt = "Mooncake" + DifferentiationInterfacePolyesterForwardDiffExt = "PolyesterForwardDiff" + DifferentiationInterfaceReverseDiffExt = "ReverseDiff" + DifferentiationInterfaceSparseArraysExt = "SparseArrays" + DifferentiationInterfaceSparseMatrixColoringsExt = "SparseMatrixColorings" + DifferentiationInterfaceStaticArraysExt = "StaticArrays" + DifferentiationInterfaceSymbolicsExt = "Symbolics" + DifferentiationInterfaceTrackerExt = "Tracker" + DifferentiationInterfaceZygoteExt = ["Zygote", "ForwardDiff"] + + [deps.DifferentiationInterface.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Diffractor = "9f5e2b26-1114-432f-b630-d3fe2085c51c" + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + FastDifferentiation = "eb9bf01b-bf85-4b60-bf87-ee5de06c00be" + FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41" + FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + Mooncake = "da2b9cff-9c12-43a0-ae48-6db2b0edb7d6" + PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" + SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + [[deps.Distributed]] deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" @@ -515,6 +622,7 @@ deps = ["Adapt", "ChainRules", "ChainRulesCore", "Compat", "Distributions", "Fil git-tree-sha1 = "02c2e6e6a137069227439fe884d729cca5b70e56" uuid = "ced4e74d-a319-5a8a-b0ac-84af2272839c" version = "0.6.57" +weakdeps = ["ForwardDiff", "LazyArrays", "ReverseDiff", "Tracker"] [deps.DistributionsAD.extensions] DistributionsADForwardDiffExt = "ForwardDiff" @@ -522,12 +630,6 @@ version = "0.6.57" DistributionsADReverseDiffExt = "ReverseDiff" DistributionsADTrackerExt = "Tracker" - [deps.DistributionsAD.weakdeps] - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" - [[deps.DocStringExtensions]] deps = ["LibGit2"] git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" @@ -556,6 +658,7 @@ deps = ["ADTypes", "AbstractMCMC", "AbstractPPL", "Accessors", "BangBang", "Bije git-tree-sha1 = "b8d3cb76b27287a0d2ef6baf8dfe23e6b911f93a" uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8" version = "0.28.6" +weakdeps = ["ChainRulesCore", "EnzymeCore", "ForwardDiff", "MCMCChains", "ReverseDiff", "ZygoteRules"] [deps.DynamicPPL.extensions] DynamicPPLChainRulesCoreExt = ["ChainRulesCore"] @@ -565,14 +668,6 @@ version = "0.28.6" DynamicPPLReverseDiffExt = ["ReverseDiff"] DynamicPPLZygoteRulesExt = ["ZygoteRules"] - [deps.DynamicPPL.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" - MCMCChains = "c7f686f2-ff18-58e9-bc7b-31028e88f75d" - ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" - ZygoteRules = "700de1a5-db45-46bc-99cf-38207098b444" - [[deps.DynamicPolynomials]] deps = ["Future", "LinearAlgebra", "MultivariatePolynomials", "MutableArithmetics", "Reexport", "Test"] git-tree-sha1 = "bbf1ace0781d9744cb697fb856bd2c3f6568dadb" @@ -596,8 +691,17 @@ git-tree-sha1 = "bdb1942cd4c45e3c678fd11569d5cccd80976237" uuid = "4e289a0a-7415-4d19-859d-a7e5c4648b56" version = "1.0.4" +[[deps.EnzymeCore]] +git-tree-sha1 = "8f205a601760f4798a10f138c3940f0451d95188" +uuid = "f151be2c-9106-41f4-ab19-57ee4f262869" +version = "0.7.8" +weakdeps = ["Adapt"] + + [deps.EnzymeCore.extensions] + AdaptExt = "Adapt" + [[deps.EpiAware]] -deps = ["ADTypes", "AbstractMCMC", "AdvancedHMC", "DataFramesMeta", "Distributions", "DocStringExtensions", "DynamicPPL", "FillArrays", "LinearAlgebra", "LogExpFunctions", "MCMCChains", "Pathfinder", "QuadGK", "Random", "Reexport", "SparseArrays", "Statistics", "Tables", "Turing"] +deps = ["ADTypes", "AbstractMCMC", "AdvancedHMC", "DataFramesMeta", "Distributions", "DocStringExtensions", "DynamicPPL", "FillArrays", "LinearAlgebra", "LogExpFunctions", "MCMCChains", "OrdinaryDiffEq", "Pathfinder", "QuadGK", "Random", "Reexport", "SparseArrays", "Statistics", "Tables", "Turing"] path = "../EpiAware" uuid = "b2eeebe4-5992-4301-9193-7ebc9f62c855" version = "0.1.0-DEV" @@ -608,6 +712,12 @@ git-tree-sha1 = "dcb08a0d93ec0b1cdc4af184b26b591e9695423a" uuid = "460bff9d-24e4-43bc-9d9f-a8973cb893f4" version = "0.1.10" +[[deps.ExponentialUtilities]] +deps = ["Adapt", "ArrayInterface", "GPUArraysCore", "GenericSchur", "LinearAlgebra", "PrecompileTools", "Printf", "SparseArrays", "libblastrampoline_jll"] +git-tree-sha1 = "8e18940a5ba7f4ddb41fe2b79b6acaac50880a86" +uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18" +version = "1.26.1" + [[deps.ExprTools]] git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" @@ -636,6 +746,44 @@ git-tree-sha1 = "4d81ed14783ec49ce9f2e168208a12ce1815aa25" uuid = "f5851436-0d7a-5f13-b9de-f02708fd171a" version = "3.3.10+1" +[[deps.FastBroadcast]] +deps = ["ArrayInterface", "LinearAlgebra", "Polyester", "Static", "StaticArrayInterface", "StrideArraysCore"] +git-tree-sha1 = "ab1b34570bcdf272899062e1a56285a53ecaae08" +uuid = "7034ab61-46d4-4ed7-9d0f-46aef9175898" +version = "0.3.5" + +[[deps.FastClosures]] +git-tree-sha1 = "acebe244d53ee1b461970f8910c235b259e772ef" +uuid = "9aa1b823-49e4-5ca5-8b0f-3971ec8bab6a" +version = "0.3.2" + +[[deps.FastLapackInterface]] +deps = ["LinearAlgebra"] +git-tree-sha1 = "cbf5edddb61a43669710cbc2241bc08b36d9e660" +uuid = "29a986be-02c6-4525-aec4-84b980013641" +version = "2.0.4" + +[[deps.FastPower]] +git-tree-sha1 = "58c3431137131577a7c379d00fea00be524338fb" +uuid = "a4df4552-cc26-4903-aec0-212e50a0e84b" +version = "1.1.1" + + [deps.FastPower.extensions] + FastPowerEnzymeExt = "Enzyme" + FastPowerForwardDiffExt = "ForwardDiff" + FastPowerMeasurementsExt = "Measurements" + FastPowerMonteCarloMeasurementsExt = "MonteCarloMeasurements" + FastPowerReverseDiffExt = "ReverseDiff" + FastPowerTrackerExt = "Tracker" + + [deps.FastPower.weakdeps] + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + [[deps.FileWatching]] uuid = "7b1f6079-737a-58dc-b8bc-7a2ca5c1b5ee" version = "1.11.0" @@ -731,6 +879,18 @@ git-tree-sha1 = "ec632f177c0d990e64d955ccc1b8c04c485a0950" uuid = "46192b85-c4d5-4398-a991-12ede77f4527" version = "0.1.6" +[[deps.GenericLinearAlgebra]] +deps = ["LinearAlgebra", "Printf", "Random", "libblastrampoline_jll"] +git-tree-sha1 = "c4f9c87b74aedf20920034bd4db81d0bffc527d2" +uuid = "14197337-ba66-59df-a3e3-ca00e7dcff7a" +version = "0.3.14" + +[[deps.GenericSchur]] +deps = ["LinearAlgebra", "Printf"] +git-tree-sha1 = "af49a0851f8113fcfae2ef5027c6d49d0acec39b" +uuid = "c145ed77-6b09-5dd9-b285-bf645a82121e" +version = "0.5.4" + [[deps.GitHub]] deps = ["Base64", "Dates", "HTTP", "JSON", "MbedTLS", "Sockets", "SodiumSeal", "URIs"] git-tree-sha1 = "7ee730a8484d673a8ce21d8536acfe6494475994" @@ -749,6 +909,12 @@ git-tree-sha1 = "1336e07ba2eb75614c99496501a8f4b233e9fafe" uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3" version = "1.10.10" +[[deps.HostCPUFeatures]] +deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"] +git-tree-sha1 = "8e070b599339d622e9a081d17230d74a5c473293" +uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0" +version = "0.1.17" + [[deps.HybridArrays]] deps = ["LinearAlgebra", "Requires", "StaticArrays"] git-tree-sha1 = "6c3e57bc26728b99f470b267a437f0d380eac4fc" @@ -885,22 +1051,24 @@ git-tree-sha1 = "31e996f0a15c7b280ba9f76636b3ff9e2ae58c9a" uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" version = "0.21.4" +[[deps.KLU]] +deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse_jll"] +git-tree-sha1 = "07649c499349dad9f08dde4243a4c597064663e9" +uuid = "ef3ab10e-7fda-4108-b977-705223b18434" +version = "0.6.0" + [[deps.KernelAbstractions]] deps = ["Adapt", "Atomix", "InteractiveUtils", "MacroTools", "PrecompileTools", "Requires", "StaticArrays", "UUIDs", "UnsafeAtomics", "UnsafeAtomicsLLVM"] git-tree-sha1 = "e73a077abc7fe798fe940deabe30ef6c66bdde52" uuid = "63c18a36-062a-441e-b654-da1e3ab1ce7c" version = "0.9.29" +weakdeps = ["EnzymeCore", "LinearAlgebra", "SparseArrays"] [deps.KernelAbstractions.extensions] EnzymeExt = "EnzymeCore" LinearAlgebraExt = "LinearAlgebra" SparseArraysExt = "SparseArrays" - [deps.KernelAbstractions.weakdeps] - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" - LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" - SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - [[deps.KernelDensity]] deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"] git-tree-sha1 = "7d703202e65efa1369de1279c162b915e245eed1" @@ -913,6 +1081,12 @@ git-tree-sha1 = "9253429e28cceae6e823bec9ffde12460d79bb38" uuid = "2c470bb0-bcc8-11e8-3dad-c9649493f05e" version = "0.5.5" +[[deps.Krylov]] +deps = ["LinearAlgebra", "Printf", "SparseArrays"] +git-tree-sha1 = "4f20a2df85a9e5d55c9e84634bbf808ed038cabd" +uuid = "ba0b0d4f-ebba-5204-a429-3ac8c609bfb7" +version = "0.9.8" + [[deps.LBFGSB]] deps = ["L_BFGS_B_jll"] git-tree-sha1 = "e2e6f53ee20605d0ea2be473480b7480bd5091b5" @@ -973,6 +1147,30 @@ version = "0.16.5" SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" +[[deps.LayoutPointers]] +deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "a9eaadb366f5493a5654e843864c13d8b107548c" +uuid = "10f19ff3-798f-405d-979b-55457f8fc047" +version = "0.1.17" + +[[deps.LazyArrays]] +deps = ["ArrayLayouts", "FillArrays", "LinearAlgebra", "MacroTools", "SparseArrays"] +git-tree-sha1 = "376bc148ae72e68a08f0d5d8a69e287025a37687" +uuid = "5078a376-72f3-5289-bfd5-ec5146d43c02" +version = "2.2.2" + + [deps.LazyArrays.extensions] + LazyArraysBandedMatricesExt = "BandedMatrices" + LazyArraysBlockArraysExt = "BlockArrays" + LazyArraysBlockBandedMatricesExt = "BlockBandedMatrices" + LazyArraysStaticArraysExt = "StaticArrays" + + [deps.LazyArrays.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" @@ -1042,6 +1240,43 @@ weakdeps = ["ChainRulesCore", "SparseArrays", "Statistics"] LinearMapsSparseArraysExt = "SparseArrays" LinearMapsStatisticsExt = "Statistics" +[[deps.LinearSolve]] +deps = ["ArrayInterface", "ChainRulesCore", "ConcreteStructs", "DocStringExtensions", "EnumX", "FastLapackInterface", "GPUArraysCore", "InteractiveUtils", "KLU", "Krylov", "LazyArrays", "Libdl", "LinearAlgebra", "MKL_jll", "Markdown", "PrecompileTools", "Preferences", "RecursiveFactorization", "Reexport", "SciMLBase", "SciMLOperators", "Setfield", "SparseArrays", "Sparspak", "StaticArraysCore", "UnPack"] +git-tree-sha1 = "6c5e4555ac2bc449a28604e184f759d18fc08420" +uuid = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +version = "2.34.0" + + [deps.LinearSolve.extensions] + LinearSolveBandedMatricesExt = "BandedMatrices" + LinearSolveBlockDiagonalsExt = "BlockDiagonals" + LinearSolveCUDAExt = "CUDA" + LinearSolveCUDSSExt = "CUDSS" + LinearSolveEnzymeExt = ["Enzyme", "EnzymeCore"] + LinearSolveFastAlmostBandedMatricesExt = ["FastAlmostBandedMatrices"] + LinearSolveHYPREExt = "HYPRE" + LinearSolveIterativeSolversExt = "IterativeSolvers" + LinearSolveKernelAbstractionsExt = "KernelAbstractions" + LinearSolveKrylovKitExt = "KrylovKit" + LinearSolveMetalExt = "Metal" + LinearSolvePardisoExt = "Pardiso" + LinearSolveRecursiveArrayToolsExt = "RecursiveArrayTools" + + [deps.LinearSolve.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockDiagonals = "0a1fb500-61f7-11e9-3c65-f5ef3456f9f0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" + FastAlmostBandedMatrices = "9d29842c-ecb8-4973-b1e9-a27b1157504e" + HYPRE = "b5ffcf37-a2bd-41ab-a3da-4bd9bc8ad771" + IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" + KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" + KrylovKit = "0b1a1467-8014-51b9-945f-bf0ae24f4b77" + Metal = "dde4c033-4e86-420c-a63e-0dd931031962" + Pardiso = "46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2" + RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" + [[deps.LogDensityProblems]] deps = ["ArgCheck", "DocStringExtensions", "Random"] git-tree-sha1 = "4e0128c1590d23a50dcdb106c7e2dbca99df85c0" @@ -1098,6 +1333,17 @@ git-tree-sha1 = "f02b56007b064fbfddb4c9cd60161b6dd0f40df3" uuid = "e6f89c97-d47a-5376-807f-9c37f3926c36" version = "1.1.0" +[[deps.LoopVectorization]] +deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "PrecompileTools", "SIMDTypes", "SLEEFPirates", "Static", "StaticArrayInterface", "ThreadingUtilities", "UnPack", "VectorizationBase"] +git-tree-sha1 = "8084c25a250e00ae427a379a5b607e7aed96a2dd" +uuid = "bdcacae8-1622-11e9-2a5c-532679323890" +version = "0.12.171" +weakdeps = ["ChainRulesCore", "ForwardDiff", "SpecialFunctions"] + + [deps.LoopVectorization.extensions] + ForwardDiffExt = ["ChainRulesCore", "ForwardDiff"] + SpecialFunctionsExt = "SpecialFunctions" + [[deps.MCMCChains]] deps = ["AbstractMCMC", "AxisArrays", "Dates", "Distributions", "IteratorInterfaceExtensions", "KernelDensity", "LinearAlgebra", "MCMCDiagnosticTools", "MLJModelInterface", "NaturalSort", "OrderedCollections", "PrettyTables", "Random", "RecipesBase", "Statistics", "StatsBase", "StatsFuns", "TableTraits", "Tables"] git-tree-sha1 = "d28056379864318172ff4b7958710cfddd709339" @@ -1194,6 +1440,11 @@ version = "0.15.21" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" +[[deps.ManualMemory]] +git-tree-sha1 = "bcaef4fc7a0cfe2cba636d84cda54b5e4e4ca3cd" +uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667" +version = "0.1.8" + [[deps.MappedArrays]] git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" uuid = "dbb5928d-eab1-5f90-85c2-b9b0edb7c900" @@ -1210,6 +1461,16 @@ git-tree-sha1 = "f765b4eda3ea9be8e644b9127809ca5151f3d9ea" uuid = "99c1a7ee-ab34-5fd5-8076-27c950a045f4" version = "2.4.2" +[[deps.MaybeInplace]] +deps = ["ArrayInterface", "LinearAlgebra", "MacroTools"] +git-tree-sha1 = "54e2fdc38130c05b42be423e90da3bade29b74bd" +uuid = "bb5d69b7-63fc-4a16-80bd-7e42200c7bdb" +version = "0.1.4" +weakdeps = ["SparseArrays"] + + [deps.MaybeInplace.extensions] + MaybeInplaceSparseArraysExt = "SparseArrays" + [[deps.MbedTLS]] deps = ["Dates", "MbedTLS_jll", "MozillaCACerts_jll", "NetworkOptions", "Random", "Sockets"] git-tree-sha1 = "c067a280ddc25f196b5e7df3877c6b226d390aaf" @@ -1241,6 +1502,11 @@ version = "1.11.0" uuid = "14a3606d-f60d-562e-9121-12d972cd8159" version = "2023.12.12" +[[deps.MuladdMacro]] +git-tree-sha1 = "cac9cc5499c25554cba55cd3c30543cff5ca4fab" +uuid = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221" +version = "0.2.4" + [[deps.MultivariatePolynomials]] deps = ["ChainRulesCore", "DataStructures", "LinearAlgebra", "MutableArithmetics"] git-tree-sha1 = "8d39779e29f80aa6c071e7ac17101c6e31f075d7" @@ -1321,6 +1587,38 @@ version = "1.0.0" uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" version = "1.2.0" +[[deps.NonlinearSolve]] +deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "FastBroadcast", "FastClosures", "FiniteDiff", "ForwardDiff", "LazyArrays", "LineSearches", "LinearAlgebra", "LinearSolve", "MaybeInplace", "PrecompileTools", "Preferences", "Printf", "RecursiveArrayTools", "Reexport", "SciMLBase", "SimpleNonlinearSolve", "SparseArrays", "SparseDiffTools", "StaticArraysCore", "SymbolicIndexingInterface", "TimerOutputs"] +git-tree-sha1 = "bcd8812e751326ff1d4b2dd50764b93df51f143b" +uuid = "8913a72c-1f9b-4ce2-8d82-65094dcecaec" +version = "3.14.0" + + [deps.NonlinearSolve.extensions] + NonlinearSolveBandedMatricesExt = "BandedMatrices" + NonlinearSolveFastLevenbergMarquardtExt = "FastLevenbergMarquardt" + NonlinearSolveFixedPointAccelerationExt = "FixedPointAcceleration" + NonlinearSolveLeastSquaresOptimExt = "LeastSquaresOptim" + NonlinearSolveMINPACKExt = "MINPACK" + NonlinearSolveNLSolversExt = "NLSolvers" + NonlinearSolveNLsolveExt = "NLsolve" + NonlinearSolveSIAMFANLEquationsExt = "SIAMFANLEquations" + NonlinearSolveSpeedMappingExt = "SpeedMapping" + NonlinearSolveSymbolicsExt = "Symbolics" + NonlinearSolveZygoteExt = "Zygote" + + [deps.NonlinearSolve.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + FastLevenbergMarquardt = "7a0df574-e128-4d35-8cbd-3d84502bf7ce" + FixedPointAcceleration = "817d07cb-a79a-5c30-9a31-890123675176" + LeastSquaresOptim = "0fc2ff8b-aaa3-5acd-a817-1944a5e08891" + MINPACK = "4854310b-de5a-5eb6-a2a5-c1dee2bd17f9" + NLSolvers = "337daf1e-9722-11e9-073e-8b9effe078ba" + NLsolve = "2774e3e8-f4cf-5e23-947b-6d7e65073b56" + SIAMFANLEquations = "084e46ad-d928-497d-ad5e-07fa361a48c4" + SpeedMapping = "f1835b91-879b-4a3f-a438-e4baacf14412" + Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + [[deps.OffsetArrays]] git-tree-sha1 = "1a27764e945a152f7ca7efa04de513d473e9542e" uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" @@ -1372,15 +1670,9 @@ version = "1.10.0" [[deps.Optimisers]] deps = ["ChainRulesCore", "Functors", "LinearAlgebra", "Random", "Statistics"] -git-tree-sha1 = "09000e0bdec3aed6e3dff553c9fb010d27de56ee" +git-tree-sha1 = "f555c1f8c6f75b10d31f94132d4acb4cbf0bdeef" uuid = "3bd65402-5787-11e9-1adc-39752487f4e2" -version = "0.4.1" - - [deps.Optimisers.extensions] - OptimisersEnzymeCoreExt = "EnzymeCore" - - [deps.Optimisers.weakdeps] - EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" +version = "0.4.0" [[deps.Optimization]] deps = ["ADTypes", "ArrayInterface", "ConsoleProgressMonitor", "DocStringExtensions", "LBFGSB", "LinearAlgebra", "Logging", "LoggingExtras", "OptimizationBase", "Printf", "ProgressLogging", "Reexport", "SciMLBase", "SparseArrays", "TerminalLoggers"] @@ -1425,6 +1717,196 @@ git-tree-sha1 = "dfdf5519f235516220579f949664f1bf44e741c5" uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" version = "1.6.3" +[[deps.OrdinaryDiffEq]] +deps = ["ADTypes", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "ExponentialUtilities", "FastBroadcast", "FastClosures", "FillArrays", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "InteractiveUtils", "LineSearches", "LinearAlgebra", "LinearSolve", "Logging", "MacroTools", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqAdamsBashforthMoulton", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqDefault", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqExplicitRK", "OrdinaryDiffEqExponentialRK", "OrdinaryDiffEqExtrapolation", "OrdinaryDiffEqFIRK", "OrdinaryDiffEqFeagin", "OrdinaryDiffEqFunctionMap", "OrdinaryDiffEqHighOrderRK", "OrdinaryDiffEqIMEXMultistep", "OrdinaryDiffEqLinear", "OrdinaryDiffEqLowOrderRK", "OrdinaryDiffEqLowStorageRK", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqNordsieck", "OrdinaryDiffEqPDIRK", "OrdinaryDiffEqPRK", "OrdinaryDiffEqQPRK", "OrdinaryDiffEqRKN", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqSSPRK", "OrdinaryDiffEqStabilizedIRK", "OrdinaryDiffEqStabilizedRK", "OrdinaryDiffEqSymplecticRK", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "Polyester", "PreallocationTools", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "SimpleUnPack", "SparseArrays", "SparseDiffTools", "Static", "StaticArrayInterface", "StaticArrays", "TruncatedStacktraces"] +git-tree-sha1 = "36ce9bfc14a4b3dcf1490e80b5f1f4d35bfddf39" +uuid = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +version = "6.90.1" + +[[deps.OrdinaryDiffEqAdamsBashforthMoulton]] +deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqLowOrderRK", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "8e3c5978d0531a961f70d2f2730d1d16ed3bbd12" +uuid = "89bda076-bce5-4f1c-845f-551c83cdda9a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqBDF]] +deps = ["ArrayInterface", "DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "OrdinaryDiffEqSDIRK", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "StaticArrays", "TruncatedStacktraces"] +git-tree-sha1 = "b4498d40bf35da0b6d22652ff2e9d8820590b3c6" +uuid = "6ad6398a-0878-4a85-9266-38940aa047c8" +version = "1.1.2" + +[[deps.OrdinaryDiffEqCore]] +deps = ["ADTypes", "Accessors", "Adapt", "ArrayInterface", "DataStructures", "DiffEqBase", "DocStringExtensions", "EnumX", "FastBroadcast", "FastClosures", "FastPower", "FillArrays", "FunctionWrappersWrappers", "InteractiveUtils", "LinearAlgebra", "Logging", "MacroTools", "MuladdMacro", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleUnPack", "Static", "StaticArrayInterface", "StaticArraysCore", "SymbolicIndexingInterface", "TruncatedStacktraces"] +git-tree-sha1 = "6f86041d5978ce3574f022f4098e0c216e2a3395" +uuid = "bbf590c4-e513-4bbe-9b18-05decba2e5d8" +version = "1.10.2" +weakdeps = ["EnzymeCore"] + + [deps.OrdinaryDiffEqCore.extensions] + OrdinaryDiffEqCoreEnzymeCoreExt = "EnzymeCore" + +[[deps.OrdinaryDiffEqDefault]] +deps = ["DiffEqBase", "EnumX", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqBDF", "OrdinaryDiffEqCore", "OrdinaryDiffEqRosenbrock", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "PrecompileTools", "Preferences", "Reexport"] +git-tree-sha1 = "c8223e487d58bef28a3535b33ddf8ffdb44f46fb" +uuid = "50262376-6c5a-4cf5-baba-aaf4f84d72d7" +version = "1.1.0" + +[[deps.OrdinaryDiffEqDifferentiation]] +deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "FunctionWrappersWrappers", "LinearAlgebra", "LinearSolve", "OrdinaryDiffEqCore", "SciMLBase", "SparseArrays", "SparseDiffTools", "StaticArrayInterface", "StaticArrays"] +git-tree-sha1 = "8977f283a7d89c5d5c06c933467ed4af0a99f2f7" +uuid = "4302a76b-040a-498a-8c04-15b101fed76b" +version = "1.2.0" + +[[deps.OrdinaryDiffEqExplicitRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "TruncatedStacktraces"] +git-tree-sha1 = "4dbce3f9e6974567082ce5176e21aab0224a69e9" +uuid = "9286f039-9fbf-40e8-bf65-aa933bdc4db0" +version = "1.1.0" + +[[deps.OrdinaryDiffEqExponentialRK]] +deps = ["DiffEqBase", "ExponentialUtilities", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqSDIRK", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase"] +git-tree-sha1 = "f63938b8e9e5d3a05815defb3ebdbdcf61ec0a74" +uuid = "e0540318-69ee-4070-8777-9e2de6de23de" +version = "1.1.0" + +[[deps.OrdinaryDiffEqExtrapolation]] +deps = ["DiffEqBase", "FastBroadcast", "FastPower", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "048bcccc8f59c20d5b4ad268eef4d7d21c005a94" +uuid = "becaefa8-8ca2-5cf9-886d-c06f3d2bd2c4" +version = "1.2.1" + +[[deps.OrdinaryDiffEqFIRK]] +deps = ["DiffEqBase", "FastBroadcast", "FastPower", "GenericLinearAlgebra", "GenericSchur", "LinearAlgebra", "LinearSolve", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polynomials", "RecursiveArrayTools", "Reexport", "RootedTrees", "SciMLOperators", "Symbolics"] +git-tree-sha1 = "1dcf5bebc5179c1c119a7a30f99bbb93eec02d44" +uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125" +version = "1.3.0" + +[[deps.OrdinaryDiffEqFeagin]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "a7cc74d3433db98e59dc3d58bc28174c6c290adf" +uuid = "101fe9f7-ebb6-4678-b671-3a81e7194747" +version = "1.1.0" + +[[deps.OrdinaryDiffEqFunctionMap]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"] +git-tree-sha1 = "925a91583d1ab84f1f0fea121be1abf1179c5926" +uuid = "d3585ca7-f5d3-4ba6-8057-292ed1abd90f" +version = "1.1.1" + +[[deps.OrdinaryDiffEqHighOrderRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "103e017ff186ac39d731904045781c9bacfca2b0" +uuid = "d28bc4f8-55e1-4f49-af69-84c1a99f0f58" +version = "1.1.0" + +[[deps.OrdinaryDiffEqIMEXMultistep]] +deps = ["DiffEqBase", "FastBroadcast", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Reexport"] +git-tree-sha1 = "9f8f52aad2399d7714b400ff9d203254b0a89c4a" +uuid = "9f002381-b378-40b7-97a6-27a27c83f129" +version = "1.1.0" + +[[deps.OrdinaryDiffEqLinear]] +deps = ["DiffEqBase", "ExponentialUtilities", "LinearAlgebra", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "OrdinaryDiffEqVerner", "RecursiveArrayTools", "Reexport", "SciMLBase", "SciMLOperators"] +git-tree-sha1 = "0f81a77ede3da0dc714ea61e81c76b25db4ab87a" +uuid = "521117fe-8c41-49f8-b3b6-30780b3f0fb5" +version = "1.1.0" + +[[deps.OrdinaryDiffEqLowOrderRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "SciMLBase", "Static"] +git-tree-sha1 = "d4bb32e09d6b68ce2eb45fb81001eab46f60717a" +uuid = "1344f307-1e59-4825-a18e-ace9aa3fa4c6" +version = "1.2.0" + +[[deps.OrdinaryDiffEqLowStorageRK]] +deps = ["Adapt", "DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"] +git-tree-sha1 = "590561f3af623d5485d070b4d7044f8854535f5a" +uuid = "b0944070-b475-4768-8dec-fb6eb410534d" +version = "1.2.1" + +[[deps.OrdinaryDiffEqNonlinearSolve]] +deps = ["ADTypes", "ArrayInterface", "DiffEqBase", "FastBroadcast", "FastClosures", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MuladdMacro", "NonlinearSolve", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "PreallocationTools", "RecursiveArrayTools", "SciMLBase", "SciMLOperators", "SciMLStructures", "SimpleNonlinearSolve", "StaticArrays"] +git-tree-sha1 = "5e1b316555fa95892edc13f6a429ac784d0be4dd" +uuid = "127b3ac7-2247-4354-8eb6-78cf4e7c58e8" +version = "1.2.4" + +[[deps.OrdinaryDiffEqNordsieck]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqTsit5", "Polyester", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "ef44754f10e0dfb9bb55ded382afed44cd94ab57" +uuid = "c9986a66-5c92-4813-8696-a7ec84c806c8" +version = "1.1.0" + +[[deps.OrdinaryDiffEqPDIRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "Polyester", "Reexport", "StaticArrays"] +git-tree-sha1 = "a8b7f8107c477e07c6a6c00d1d66cac68b801bbc" +uuid = "5dd0a6cf-3d4b-4314-aa06-06d4e299bc89" +version = "1.1.0" + +[[deps.OrdinaryDiffEqPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "Reexport"] +git-tree-sha1 = "da525d277962a1b76102c79f30cb0c31e13fe5b9" +uuid = "5b33eab2-c0f1-4480-b2c3-94bc1e80bda1" +version = "1.1.0" + +[[deps.OrdinaryDiffEqQPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "332f9d17d0229218f66a73492162267359ba85e9" +uuid = "04162be5-8125-4266-98ed-640baecc6514" +version = "1.1.0" + +[[deps.OrdinaryDiffEqRKN]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "41c09d9c20877546490f907d8dffdd52690dd65f" +uuid = "af6ede74-add8-4cfd-b1df-9a4dbb109d7a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqRosenbrock]] +deps = ["ADTypes", "DiffEqBase", "FastBroadcast", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "LinearSolve", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static"] +git-tree-sha1 = "760a51a626d0065455847e4a3f788b07e86e5090" +uuid = "43230ef6-c299-4910-a778-202eb28ce4ce" +version = "1.3.1" + +[[deps.OrdinaryDiffEqSDIRK]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MacroTools", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "SciMLBase", "TruncatedStacktraces"] +git-tree-sha1 = "f6683803a58de600ab7a26d2f49411c9923e9721" +uuid = "2d112036-d095-4a1e-ab9a-08536f3ecdbf" +version = "1.1.0" + +[[deps.OrdinaryDiffEqSSPRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "StaticArrays"] +git-tree-sha1 = "7dbe4ac56f930df5e9abd003cedb54e25cbbea86" +uuid = "669c94d9-1f4b-4b64-b377-1aa079aa2388" +version = "1.2.0" + +[[deps.OrdinaryDiffEqStabilizedIRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "OrdinaryDiffEqDifferentiation", "OrdinaryDiffEqNonlinearSolve", "RecursiveArrayTools", "Reexport", "StaticArrays"] +git-tree-sha1 = "348fd6def9a88518715425025eadd58517017325" +uuid = "e3e12d00-db14-5390-b879-ac3dd2ef6296" +version = "1.1.0" + +[[deps.OrdinaryDiffEqStabilizedRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "RecursiveArrayTools", "Reexport", "StaticArrays"] +git-tree-sha1 = "1b0d894c880e25f7d0b022d7257638cf8ce5b311" +uuid = "358294b1-0aab-51c3-aafe-ad5ab194a2ad" +version = "1.1.0" + +[[deps.OrdinaryDiffEqSymplecticRK]] +deps = ["DiffEqBase", "FastBroadcast", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "RecursiveArrayTools", "Reexport"] +git-tree-sha1 = "4e8b8c8b81df3df17e2eb4603115db3b30a88235" +uuid = "fa646aed-7ef9-47eb-84c4-9443fc8cbfa8" +version = "1.1.0" + +[[deps.OrdinaryDiffEqTsit5]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "TruncatedStacktraces"] +git-tree-sha1 = "96552f7d4619fabab4038a29ed37dd55e9eb513a" +uuid = "b1df2697-797e-41e3-8120-5422d3b24e4a" +version = "1.1.0" + +[[deps.OrdinaryDiffEqVerner]] +deps = ["DiffEqBase", "FastBroadcast", "LinearAlgebra", "MuladdMacro", "OrdinaryDiffEqCore", "Polyester", "PrecompileTools", "Preferences", "RecursiveArrayTools", "Reexport", "Static", "TruncatedStacktraces"] +git-tree-sha1 = "81d7841e73e385b9925d5c8e4427f2adcdda55db" +uuid = "79d7bb75-1356-48c1-b8c0-6832512096c2" +version = "1.1.1" + [[deps.PDMats]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] git-tree-sha1 = "949347156c25054de2db3b166c52ac4728cbad65" @@ -1437,6 +1919,12 @@ git-tree-sha1 = "08598dfcf5dd14db4425641abfc301b817b921f0" uuid = "ce719bf2-d5d0-4fb9-925d-10a81b42ad04" version = "0.9.6" +[[deps.PackageExtensionCompat]] +git-tree-sha1 = "fb28e33b8a95c4cee25ce296c817d89cc2e53518" +uuid = "65ce6f38-6b18-4e1d-a461-8949797d7930" +version = "1.0.2" +weakdeps = ["Requires", "TOML"] + [[deps.Parameters]] deps = ["OrderedCollections", "UnPack"] git-tree-sha1 = "34c0e9ad262e5f7fc75b10a9952ca7692cfc5fbe" @@ -1483,6 +1971,18 @@ git-tree-sha1 = "e4a10b7cdb7ec836850e43a4cee196f4e7b02756" uuid = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d" version = "0.2.12" +[[deps.Polyester]] +deps = ["ArrayInterface", "BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "ManualMemory", "PolyesterWeave", "Static", "StaticArrayInterface", "StrideArraysCore", "ThreadingUtilities"] +git-tree-sha1 = "6d38fea02d983051776a856b7df75b30cf9a3c1f" +uuid = "f517fe37-dbe3-4b94-8317-1923a5111588" +version = "0.7.16" + +[[deps.PolyesterWeave]] +deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"] +git-tree-sha1 = "645bed98cd47f72f67316fd42fc47dee771aefcd" +uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad" +version = "0.2.2" + [[deps.Polynomials]] deps = ["LinearAlgebra", "RecipesBase", "Requires", "Setfield", "SparseArrays"] git-tree-sha1 = "1a9cfb2dc2c2f1bd63f1906d72af39a79b49b736" @@ -1513,6 +2013,16 @@ git-tree-sha1 = "17275485f373e6673f7e7f97051f703ed5b15b20" uuid = "85a6dd25-e78a-55b7-8502-1745935b8125" version = "0.2.4" +[[deps.PreallocationTools]] +deps = ["Adapt", "ArrayInterface", "ForwardDiff"] +git-tree-sha1 = "6c62ce45f268f3f958821a1e5192cf91c75ae89c" +uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" +version = "0.4.24" +weakdeps = ["ReverseDiff"] + + [deps.PreallocationTools.extensions] + PreallocationToolsReverseDiffExt = "ReverseDiff" + [[deps.PrecompileTools]] deps = ["Preferences"] git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" @@ -1653,6 +2163,12 @@ version = "3.27.3" Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" +[[deps.RecursiveFactorization]] +deps = ["LinearAlgebra", "LoopVectorization", "Polyester", "PrecompileTools", "StrideArraysCore", "TriangularSolve"] +git-tree-sha1 = "6db1a75507051bc18bfa131fbc7c3f169cc4b2f6" +uuid = "f2c3362d-daeb-58d1-803e-2bc74f2840b4" +version = "0.2.23" + [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" @@ -1688,6 +2204,18 @@ git-tree-sha1 = "58cdd8fb2201a6267e1db87ff148dd6c1dbd8ad8" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" version = "0.5.1+0" +[[deps.RootedTrees]] +deps = ["LaTeXStrings", "Latexify", "LinearAlgebra", "Preferences", "RecipesBase", "Requires"] +git-tree-sha1 = "c0c464d3063e46e4128d21fd677ca575ace44fdc" +uuid = "47965b36-3f3e-11e9-0dcf-4570dfd42a8c" +version = "2.23.1" + + [deps.RootedTrees.extensions] + PlotsExt = "Plots" + + [deps.RootedTrees.weakdeps] + Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" + [[deps.Roots]] deps = ["Accessors", "CommonSolve", "Printf"] git-tree-sha1 = "3a7c7e5c3f015415637f5debdf8a674aa2c979c4" @@ -1718,6 +2246,17 @@ version = "0.5.13" uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" version = "0.7.0" +[[deps.SIMDTypes]] +git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c" +uuid = "94e857df-77ce-4151-89e5-788b33177be4" +version = "0.1.0" + +[[deps.SLEEFPirates]] +deps = ["IfElse", "Static", "VectorizationBase"] +git-tree-sha1 = "456f610ca2fbd1c14f5fcf31c6bfadc55e7d66e0" +uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa" +version = "0.6.43" + [[deps.SSMProblems]] deps = ["AbstractMCMC"] git-tree-sha1 = "f640e4e8343c9d5f470e2f6ca6ce79f708ab6376" @@ -1726,9 +2265,9 @@ version = "0.1.1" [[deps.SciMLBase]] deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "Expronicon", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface"] -git-tree-sha1 = "f9195449e0ae7e8daf9d609c9619ecfc2369f62c" +git-tree-sha1 = "cacc7bc54bab8749b1fc1032c4911fe80cffb959" uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" -version = "2.60.0" +version = "2.61.0" [deps.SciMLBase.extensions] SciMLBaseChainRulesCoreExt = "ChainRulesCore" @@ -1797,6 +2336,19 @@ git-tree-sha1 = "f305871d2f381d21527c770d4788c06c097c9bc1" uuid = "777ac1f9-54b0-4bf8-805c-2214025038e7" version = "1.2.0" +[[deps.SimpleNonlinearSolve]] +deps = ["ADTypes", "ArrayInterface", "ConcreteStructs", "DiffEqBase", "DiffResults", "DifferentiationInterface", "FastClosures", "FiniteDiff", "ForwardDiff", "LinearAlgebra", "MaybeInplace", "PrecompileTools", "Reexport", "SciMLBase", "Setfield", "StaticArraysCore"] +git-tree-sha1 = "44021f3efc023be3871195d8ad98b865001a2fa1" +uuid = "727e6d20-b764-4bd8-a329-72de5adea6c7" +version = "1.12.3" +weakdeps = ["ChainRulesCore", "ReverseDiff", "Tracker", "Zygote"] + + [deps.SimpleNonlinearSolve.extensions] + SimpleNonlinearSolveChainRulesCoreExt = "ChainRulesCore" + SimpleNonlinearSolveReverseDiffExt = "ReverseDiff" + SimpleNonlinearSolveTrackerExt = "Tracker" + SimpleNonlinearSolveZygoteExt = "Zygote" + [[deps.SimpleTraits]] deps = ["InteractiveUtils", "MacroTools"] git-tree-sha1 = "5d7e3f4e11935503d3ecaf7186eac40602e7d231" @@ -1835,12 +2387,38 @@ deps = ["Libdl", "LinearAlgebra", "Random", "Serialization", "SuiteSparse_jll"] uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" version = "1.11.0" +[[deps.SparseDiffTools]] +deps = ["ADTypes", "Adapt", "ArrayInterface", "Compat", "DataStructures", "FiniteDiff", "ForwardDiff", "Graphs", "LinearAlgebra", "PackageExtensionCompat", "Random", "Reexport", "SciMLOperators", "Setfield", "SparseArrays", "StaticArrayInterface", "StaticArrays", "UnPack", "VertexSafeGraphs"] +git-tree-sha1 = "b906758c107b049b6b71599b9f928d9b14e5554a" +uuid = "47a9eef4-7e08-11e9-0b38-333d64bd3804" +version = "2.23.0" + + [deps.SparseDiffTools.extensions] + SparseDiffToolsEnzymeExt = "Enzyme" + SparseDiffToolsPolyesterExt = "Polyester" + SparseDiffToolsPolyesterForwardDiffExt = "PolyesterForwardDiff" + SparseDiffToolsSymbolicsExt = "Symbolics" + SparseDiffToolsZygoteExt = "Zygote" + + [deps.SparseDiffTools.weakdeps] + Enzyme = "7da242da-08ed-463a-9acd-ee780be4f1d9" + Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588" + PolyesterForwardDiff = "98d1487c-24ca-40b6-b7ab-df2af84e126b" + Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + [[deps.SparseInverseSubset]] deps = ["LinearAlgebra", "SparseArrays", "SuiteSparse"] git-tree-sha1 = "52962839426b75b3021296f7df242e40ecfc0852" uuid = "dc90abb0-5640-4711-901d-7e5b23a2fada" version = "0.1.2" +[[deps.Sparspak]] +deps = ["Libdl", "LinearAlgebra", "Logging", "OffsetArrays", "Printf", "SparseArrays", "Test"] +git-tree-sha1 = "342cf4b449c299d8d1ceaf00b7a49f4fbc7940e7" +uuid = "e56a9233-b9d6-4f03-8d0f-1825330902ac" +version = "0.3.9" + [[deps.SpecialFunctions]] deps = ["IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"] git-tree-sha1 = "2f5d4697f21388cbe1ff299430dd169ef97d7e14" @@ -1857,6 +2435,23 @@ git-tree-sha1 = "e08a62abc517eb79667d0a29dc08a3b589516bb5" uuid = "171d559e-b47b-412a-8079-5efa626c420e" version = "0.1.15" +[[deps.Static]] +deps = ["CommonWorldInvalidations", "IfElse", "PrecompileTools"] +git-tree-sha1 = "87d51a3ee9a4b0d2fe054bdd3fc2436258db2603" +uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3" +version = "1.1.1" + +[[deps.StaticArrayInterface]] +deps = ["ArrayInterface", "Compat", "IfElse", "LinearAlgebra", "PrecompileTools", "Static"] +git-tree-sha1 = "96381d50f1ce85f2663584c8e886a6ca97e60554" +uuid = "0d7ed370-da01-4f52-bd93-41d350b8b718" +version = "1.8.0" +weakdeps = ["OffsetArrays", "StaticArrays"] + + [deps.StaticArrayInterface.extensions] + StaticArrayInterfaceOffsetArraysExt = "OffsetArrays" + StaticArrayInterfaceStaticArraysExt = "StaticArrays" + [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] git-tree-sha1 = "777657803913ffc7e8cc20f0fd04b634f871af8f" @@ -1912,6 +2507,12 @@ weakdeps = ["ChainRulesCore", "InverseFunctions"] StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsInverseFunctionsExt = "InverseFunctions" +[[deps.StrideArraysCore]] +deps = ["ArrayInterface", "CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static", "StaticArrayInterface", "ThreadingUtilities"] +git-tree-sha1 = "f35f6ab602df8413a50c4a25ca14de821e8605fb" +uuid = "7792a7ef-975c-4747-a70f-980b88e8d1da" +version = "0.5.7" + [[deps.StringManipulation]] deps = ["PrecompileTools"] git-tree-sha1 = "a6b1675a536c5ad1a60e5a5153e1fee12eb146e3" @@ -2044,6 +2645,12 @@ git-tree-sha1 = "ca1ba3000289eacba571aaa4efcefb642e7a1de6" uuid = "24d252fe-5d94-4a69-83ea-56a14333d47a" version = "0.1.0" +[[deps.ThreadingUtilities]] +deps = ["ManualMemory"] +git-tree-sha1 = "eda08f7e9818eb53661b3deb74e3159460dfbc27" +uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5" +version = "0.5.2" + [[deps.TimerOutputs]] deps = ["ExprTools", "Printf"] git-tree-sha1 = "3a6f063d690135f5c1ba351412c82bae4d1402bf" @@ -2087,6 +2694,18 @@ version = "0.4.84" OnlineStatsBase = "925886fa-5bf2-5e8e-b522-a9147a512338" Referenceables = "42d2dcc6-99eb-4e98-b66c-637b7d73030e" +[[deps.TriangularSolve]] +deps = ["CloseOpenIntervals", "IfElse", "LayoutPointers", "LinearAlgebra", "LoopVectorization", "Polyester", "Static", "VectorizationBase"] +git-tree-sha1 = "be986ad9dac14888ba338c2554dcfec6939e1393" +uuid = "d5829a12-d9aa-46ab-831f-fb7c9ab06edf" +version = "0.2.1" + +[[deps.TruncatedStacktraces]] +deps = ["InteractiveUtils", "MacroTools", "Preferences"] +git-tree-sha1 = "ea3e54c2bdde39062abf5a9758a23735558705e1" +uuid = "781d530d-4396-4725-bb49-402e4bee1e77" +version = "1.4.0" + [[deps.Turing]] deps = ["ADTypes", "AbstractMCMC", "Accessors", "AdvancedHMC", "AdvancedMH", "AdvancedPS", "AdvancedVI", "BangBang", "Bijectors", "Compat", "DataStructures", "Distributions", "DistributionsAD", "DocStringExtensions", "DynamicPPL", "EllipticalSliceSampling", "ForwardDiff", "Libtask", "LinearAlgebra", "LogDensityProblems", "LogDensityProblemsAD", "MCMCChains", "NamedArrays", "Optimization", "OptimizationOptimJL", "OrderedCollections", "Printf", "Random", "Reexport", "Requires", "SciMLBase", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] git-tree-sha1 = "f69f33f7862a66674c279fe9b86b457a96767e35" @@ -2160,6 +2779,18 @@ git-tree-sha1 = "2d17fabcd17e67d7625ce9c531fb9f40b7c42ce4" uuid = "d80eeb9a-aca5-4d75-85e5-170c8b632249" version = "0.2.1" +[[deps.VectorizationBase]] +deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static", "StaticArrayInterface"] +git-tree-sha1 = "4ab62a49f1d8d9548a1c8d1a75e5f55cf196f64e" +uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f" +version = "0.21.71" + +[[deps.VertexSafeGraphs]] +deps = ["Graphs"] +git-tree-sha1 = "8351f8d73d7e880bfc042a8b6922684ebeafb35c" +uuid = "19fa3120-7c27-5ec5-8db8-b0b0aa330d6f" +version = "0.2.0" + [[deps.WoodburyMatrices]] deps = ["LinearAlgebra", "SparseArrays"] git-tree-sha1 = "c1a7aa6219628fcd757dede0ca95e245c5cd9511" diff --git a/pipeline/src/infer/generate_inference_results.jl b/pipeline/src/infer/generate_inference_results.jl index 03c63d61b..5254feecc 100644 --- a/pipeline/src/infer/generate_inference_results.jl +++ b/pipeline/src/infer/generate_inference_results.jl @@ -26,7 +26,8 @@ function generate_inference_results( prfx = _inference_prefix(truthdata, inference_config, pipeline) _datadir_str = _get_inferencedatadir_str(pipeline) - inference_results, inferencefile = produce_or_load( + inference_results, + inferencefile = produce_or_load( infer, config, _datadir_str; prefix = prfx) return inference_results end @@ -63,7 +64,8 @@ function generate_inference_results( datadir_name = mktempdir() - inference_results, inferencefile = produce_or_load( + inference_results, + inferencefile = produce_or_load( infer, config, datadir_name; prefix = prfx) return inference_results end diff --git a/pipeline/src/infer/inference_helpers.jl b/pipeline/src/infer/inference_helpers.jl index 057afbaa3..e4608702b 100644 --- a/pipeline/src/infer/inference_helpers.jl +++ b/pipeline/src/infer/inference_helpers.jl @@ -61,7 +61,9 @@ end """ Internal method for setting the data directory path for the inference data. """ -_get_inferencedatadir_str(pipeline::AbstractEpiAwarePipeline) = datadir("epiaware_observables") +function _get_inferencedatadir_str(pipeline::AbstractEpiAwarePipeline) + datadir("epiaware_observables") +end function _get_inferencedatadir_str(pipeline::AbstractRtwithoutRenewalPipeline) pipeline.testmode ? mktempdir() : pipeline.priorpredictive ? datadir("priorpredictive") : datadir("epiaware_observables") diff --git a/pipeline/src/plotting/figureone.jl b/pipeline/src/plotting/figureone.jl index e6da279a2..5e05dbc6a 100644 --- a/pipeline/src/plotting/figureone.jl +++ b/pipeline/src/plotting/figureone.jl @@ -20,7 +20,8 @@ function _figure_one_scenario(analysis_df, scenario; reference_time, true_gi_cho model_plotting_data = analysis_df |> df -> @subset(df, :True_GI_Mean.==true_gi_choice) |> df -> @subset(df, :Used_GI_Mean.==used_gi_choice) |> - df -> @subset(df, :Reference_Time.==reference_time) |> + df -> @subset(df, + :Reference_Time.==reference_time) |> df -> @subset(df, :Scenario.==scenario) |> data @@ -141,7 +142,8 @@ function _figure_one_model_panel( model_plotting_data = analysis_df |> df -> @subset(df, :True_GI_Mean.==true_gi_choice) |> df -> @subset(df, :Used_GI_Mean.==used_gi_choice) |> - df -> @subset(df, :Reference_Time.==reference_time) |> + df -> @subset(df, + :Reference_Time.==reference_time) |> df -> @subset(df, :Scenario.==scenario) |> df -> @subset(df, :Target.==target) |> df -> @subset(df, diff --git a/pipeline/src/scoring/summarise_crps.jl b/pipeline/src/scoring/summarise_crps.jl index 1530e846c..9e47f5298 100644 --- a/pipeline/src/scoring/summarise_crps.jl +++ b/pipeline/src/scoring/summarise_crps.jl @@ -13,7 +13,10 @@ function summarise_crps(config, inference_results, forecast_results, epidata) ts = config.tspan[1]:min(config.tspan[2] + config.lookahead, length(config.truth_I_t)) procs_names = (:log_I_t, :rt, :Rt, :I_t, :log_Rt) - scores_log_I_t, scores_rt, scores_Rt, scores_I_t, scores_log_Rt = _process_crps_scores( + scores_log_I_t, scores_rt, + scores_Rt, + scores_I_t, + scores_log_Rt = _process_crps_scores( procs_names, inference_results, forecast_results, config, ts, epidata) scores_y_t, scores_log_y_t = _cases_crps_scores(forecast_results, config, ts) diff --git a/pipeline/src/simulate/generate_truthdata.jl b/pipeline/src/simulate/generate_truthdata.jl index 373d5cb3d..81e2c4543 100644 --- a/pipeline/src/simulate/generate_truthdata.jl +++ b/pipeline/src/simulate/generate_truthdata.jl @@ -68,7 +68,8 @@ function generate_truthdata( cluster_factor = default_params["cluster_factor"], I0 = default_params["I0"]) datadir_str = mktempdir() - truthdata, truthfile = produce_or_load( + truthdata, + truthfile = produce_or_load( simulate, config, datadir(datadir_str); prefix = prefix) if plot plot_truth_data(truthdata, config, pipeline) diff --git a/pipeline/src/utils/timeseries_utils.jl b/pipeline/src/utils/timeseries_utils.jl index ce94e49c2..a3c71d4ae 100644 --- a/pipeline/src/utils/timeseries_utils.jl +++ b/pipeline/src/utils/timeseries_utils.jl @@ -25,8 +25,10 @@ end """ Internal function for reducing a sequence of results from calls to `calculate_processes`. """ -_process_reduction(procs_1, procs_2) = (; log_I_t = hcat(procs_1.log_I_t, procs_2.log_I_t), - Rt = hcat(procs_1.Rt, procs_2.Rt), rt = hcat(procs_1.rt, procs_2.rt)) +function _process_reduction(procs_1, procs_2) + (; log_I_t = hcat(procs_1.log_I_t, procs_2.log_I_t), + Rt = hcat(procs_1.Rt, procs_2.Rt), rt = hcat(procs_1.rt, procs_2.rt)) +end """ Generate quantiles for targets based on the output and EpiData. diff --git a/pipeline/test/plotting/test_plot_funcs.jl b/pipeline/test/plotting/test_plot_funcs.jl index 5dd2aa8c0..61e048227 100644 --- a/pipeline/test/plotting/test_plot_funcs.jl +++ b/pipeline/test/plotting/test_plot_funcs.jl @@ -8,7 +8,8 @@ subdirname = "test" testpipeline = RtwithoutRenewalPriorPipeline() - f, path = plot_truth_data( + f, + path = plot_truth_data( data, config, testpipeline; plotsubdir = subdirname, saveplot = false) @test f isa Figure @test path isa String