@@ -28,7 +28,7 @@ timestep_mean(sim, ::Colon) = timeseries_steps_mean(sim)
28
28
function timestep_median (sim, i)
29
29
arr = componentwise_vectors_timestep (sim, i)
30
30
if typeof (first (arr)) <: AbstractArray
31
- return reshape ([median (x) for x in arr], size (sim[1 ][i])... )
31
+ return reshape ([median (x) for x in arr], size (sim. u [1 ][i])... )
32
32
else
33
33
return median (arr)
34
34
end
@@ -37,7 +37,7 @@ timestep_median(sim, ::Colon) = timeseries_steps_median(sim)
37
37
function timestep_quantile (sim, q, i)
38
38
arr = componentwise_vectors_timestep (sim, i)
39
39
if typeof (first (arr)) <: AbstractArray
40
- return reshape ([quantile (x, q) for x in arr], size (sim[1 ][i])... )
40
+ return reshape ([quantile (x, q) for x in arr], size (sim. u [1 ][i])... )
41
41
else
42
42
return quantile (arr, q)
43
43
end
@@ -61,51 +61,51 @@ function timestep_weighted_meancov(sim, W, ::Colon, ::Colon)
61
61
end
62
62
63
63
function timeseries_steps_mean (sim)
64
- DiffEqArray ([timestep_mean (sim, i) for i in 1 : length (sim[1 ])], sim[1 ]. t)
64
+ DiffEqArray ([timestep_mean (sim, i) for i in 1 : length (sim. u [1 ])], sim. u [1 ]. t)
65
65
end
66
66
function timeseries_steps_median (sim)
67
- DiffEqArray ([timestep_median (sim, i) for i in 1 : length (sim[1 ])], sim[1 ]. t)
67
+ DiffEqArray ([timestep_median (sim, i) for i in 1 : length (sim. u [1 ])], sim. u [1 ]. t)
68
68
end
69
69
function timeseries_steps_quantile (sim, q)
70
- DiffEqArray ([timestep_quantile (sim, q, i) for i in 1 : length (sim[1 ])], sim[1 ]. t)
70
+ DiffEqArray ([timestep_quantile (sim, q, i) for i in 1 : length (sim. u [1 ])], sim. u [1 ]. t)
71
71
end
72
72
function timeseries_steps_meanvar (sim)
73
73
m, v = timestep_meanvar (sim, 1 )
74
74
means = [m]
75
75
vars = [v]
76
- for i in 2 : length (sim[1 ])
76
+ for i in 2 : length (sim. u [1 ])
77
77
m, v = timestep_meanvar (sim, i)
78
78
push! (means, m)
79
79
push! (vars, v)
80
80
end
81
- DiffEqArray (means, sim[1 ]. t), DiffEqArray (vars, sim[1 ]. t)
81
+ DiffEqArray (means, sim. u [1 ]. t), DiffEqArray (vars, sim. u [1 ]. t)
82
82
end
83
83
function timeseries_steps_meancov (sim)
84
- reshape ([timestep_meancov (sim, i, j) for i in 1 : length (sim[1 ])
85
- for j in 1 : length (sim[1 ])], length (sim[1 ]), length (sim[1 ]))
84
+ reshape ([timestep_meancov (sim, i, j) for i in 1 : length (sim. u [1 ])
85
+ for j in 1 : length (sim. u [1 ])], length (sim. u [1 ]), length (sim. u [1 ]))
86
86
end
87
87
function timeseries_steps_meancor (sim)
88
- reshape ([timestep_meancor (sim, i, j) for i in 1 : length (sim[1 ])
89
- for j in 1 : length (sim[1 ])], length (sim[1 ]), length (sim[1 ]))
88
+ reshape ([timestep_meancor (sim, i, j) for i in 1 : length (sim. u [1 ])
89
+ for j in 1 : length (sim. u [1 ])], length (sim. u [1 ]), length (sim. u [1 ]))
90
90
end
91
91
function timeseries_steps_weighted_meancov (sim, W)
92
- reshape ([timestep_meancov (sim, W, i, j) for i in 1 : length (sim[1 ])
93
- for j in 1 : length (sim[1 ])], length (sim[1 ]), length (sim[1 ]))
92
+ reshape ([timestep_meancov (sim, W, i, j) for i in 1 : length (sim. u [1 ])
93
+ for j in 1 : length (sim. u [1 ])], length (sim. u [1 ]), length (sim. u [1 ]))
94
94
end
95
95
96
96
timepoint_mean (sim, t) = componentwise_mean (get_timepoint (sim, t))
97
97
function timepoint_median (sim, t)
98
98
arr = componentwise_vectors_timepoint (sim, t)
99
99
if typeof (first (arr)) <: AbstractArray
100
- return reshape ([median (x) for x in arr], size (sim[1 ][1 ])... )
100
+ return reshape ([median (x) for x in arr], size (sim. u [1 ][1 ])... )
101
101
else
102
102
return median (arr)
103
103
end
104
104
end
105
105
function timepoint_quantile (sim, q, t)
106
106
arr = componentwise_vectors_timepoint (sim, t)
107
107
if typeof (first (arr)) <: AbstractArray
108
- return reshape ([quantile (x, q) for x in arr], size (sim[1 ][1 ])... )
108
+ return reshape ([quantile (x, q) for x in arr], size (sim. u [1 ][1 ])... )
109
109
else
110
110
return quantile (arr, q)
111
111
end
@@ -122,8 +122,8 @@ function timepoint_weighted_meancov(sim, W, t1, t2)
122
122
end
123
123
124
124
function SciMLBase. EnsembleSummary (sim:: SciMLBase.AbstractEnsembleSolution{T, N} ,
125
- t = sim[1 ]. t; quantiles = [0.05 , 0.95 ]) where {T, N}
126
- if sim[1 ] isa SciMLSolution
125
+ t = sim. u [1 ]. t; quantiles = [0.05 , 0.95 ]) where {T, N}
126
+ if sim. u [1 ] isa SciMLSolution
127
127
m, v = timeseries_point_meanvar (sim, t)
128
128
med = timeseries_point_median (sim, t)
129
129
qlow = timeseries_point_quantile (sim, quantiles[1 ], t)
0 commit comments