I am new to Julia and I am looking for a way to do Morris analysis on an system of ODEs. I would like to get a analysis as time series. Additionally, I would like to get the tested parameters to use these as a virtual patient cohort. Unfortunately, I did not manage to run the example successfully…
I tested the Lotka-Volterra Global Sensitivities Analysis example (Global Sensitivity Analysis · DifferentialEquations.jl) for the Morris analysis and did not manage to get comparable results for means and variances.
using DiffEqSensitivity, Statistics, OrdinaryDiffEq, Plots
function f(du,u,p,t)
du[1] = p[1]*u[1] - p[2]*u[1]*u[2] #prey
du[2] = -p[3]*u[2] + p[4]*u[1]*u[2] #predator
end
u0 = [1.0;1.0]
tspan = (0.0,10.0)
p = [1.5,1.0,3.0,1.0]
prob = ODEProblem(f,u0,tspan,p)
t = collect(range(0, stop=10, length=200))
f1 = function (p)
prob1 = remake(prob;p=p)
sol = solve(prob1,Tsit5();saveat=t)
[mean(sol[1,:]), maximum(sol[2,:])]
end
m = gsa(f1,Morris(total_num_trajectory=1000,num_trajectory=150),[[1,5],[1,5],[1,5],[1,5]])
Since this is a copy of the given example I do not unterstand why my output looks like that:
m.means
2×4 Array{Float64,2}:
0.0186182 -0.0224811 0.345511 -0.392407
0.716902 -1.5517 -0.0182938 0.0223239
Even though I think that getting a 2x4 output for a system of 2 equations and 4 parameters do make sense.
Additionally, I am wondering about negative outputs…
Thanks,
S