Skip to content

Commit

Permalink
Merge pull request #4 from max-de-rooij/ensemble-modelling
Browse files Browse the repository at this point in the history
Update model
  • Loading branch information
max-de-rooij authored Oct 11, 2023
2 parents 116adea + 6fa2c76 commit 5202d52
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 46 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# MealModel

[![Stable](https://img.shields.io/badge/docs-stable-blue.svg)](https://max-de-rooij.github.io/MealModel.jl/stable/)
[![Dev](https://img.shields.io/badge/docs-dev-blue.svg)](https://max-de-rooij.github.io/MealModel.jl/dev/)
[![Build Status](https://github.com/max-de-rooij/MealModel.jl/actions/workflows/CI.yml/badge.svg?branch=main)](https://github.com/max-de-rooij/MealModel.jl/actions/workflows/CI.yml?query=branch%3Amain)
[![codecov](https://codecov.io/gh/max-de-rooij/MealModel.jl/branch/main/graph/badge.svg?token=GDWQBJQBXD)](https://codecov.io/gh/max-de-rooij/MealModel.jl)

3 changes: 0 additions & 3 deletions docs/Project.toml

This file was deleted.

25 changes: 0 additions & 25 deletions docs/make.jl

This file was deleted.

14 changes: 0 additions & 14 deletions docs/src/index.md

This file was deleted.

47 changes: 47 additions & 0 deletions notebooks/MealModel.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"using MealModel"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"MixedMealModel(SciMLBase.ODEProblem{Vector{Float64}, Tuple{Float64, Float64}, true, Vector{Float64}, SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, MealModel.var\"#3#4\"{Float64, Float64, Float64, Float64, Float64, Float64, Float64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}, Base.Pairs{Symbol, SciMLSensitivity.ForwardDiffSensitivity{0, nothing}, Tuple{Symbol}, NamedTuple{(:sensealg,), Tuple{SciMLSensitivity.ForwardDiffSensitivity{0, nothing}}}}, SciMLBase.StandardODEProblem}(SciMLBase.ODEFunction{true, SciMLBase.FullSpecialize, MealModel.var\"#3#4\"{Float64, Float64, Float64, Float64, Float64, Float64, Float64}, LinearAlgebra.UniformScaling{Bool}, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, Nothing, typeof(SciMLBase.DEFAULT_OBSERVED), Nothing, Nothing}(MealModel.var\"#3#4\"{Float64, Float64, Float64, Float64, Float64, Float64, Float64}(0.1, 9.0, 3.0, 31.0, 1.0, 0.00113, 0.005551), LinearAlgebra.UniformScaling{Bool}(true), nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, nothing, SciMLBase.DEFAULT_OBSERVED, nothing, nothing), [0.0, 5.0, 0.0, 18.0, 0.0, 18.0, 18.0, 18.0, 0.33, 0.0, 0.0, 0.0, 1.3], (0.0, 480.0), [0.0105, 0.28, 0.00607, 0.000235, 0.0424, 2.2975, 1.15, 7.27, 0.0383, 0.284 … 0.0385, 0.0713, 208.88, 0.0088, 0.0163, 1.0e-5, 0.0119, 75000.0, 60000.0, 84.2], Base.Pairs(:sensealg => SciMLSensitivity.ForwardDiffSensitivity{0, nothing}()), SciMLBase.StandardODEProblem()), [1, 5, 6, 17, 20, 21, 23, 25])"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"model = MixedMealModel()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.9.3",
"language": "julia",
"name": "julia-1.9"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.9.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
1 change: 0 additions & 1 deletion src/MealModel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using Trapz

include("model/Model.jl")
include("simulation/Simulation.jl")
include("assimilation/Assimilation.jl")

# model constructor
export MixedMealModel
Expand Down
1 change: 0 additions & 1 deletion src/assimilation/Assimilation.jl

This file was deleted.

3 changes: 3 additions & 0 deletions src/assimilation/Loss.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ function make_loss(model::MixedMealModel, error::Function; save_timestep = 0.5)
_loss
end

make_loss(model::MixedMealModel, data...; save_timestep = 0.5) = make_loss(model, make_error(
model, data...; save_timestep = save_timestep); save_timestep = save_timestep)

function make_error(model::MixedMealModel, glucose_data, glucose_timepoints, insulin_data, insulin_timepoints, tg_data, tg_timepoints, nefa_data, nefa_timepoints; save_timestep = 0.5)

# times
Expand Down

0 comments on commit 5202d52

Please sign in to comment.