From 090b9a26d595864711380fbc12d0e33cd6d56abd Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 29 Jul 2018 06:59:44 -0700 Subject: [PATCH] add summary path for array outputs --- src/analysis.jl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/analysis.jl b/src/analysis.jl index 08add92..4529db9 100644 --- a/src/analysis.jl +++ b/src/analysis.jl @@ -101,9 +101,16 @@ timepoint_weighted_meancov(sim,W,t1,t2) = componentwise_weighted_meancov(get_tim function MonteCarloSummary(sim::DiffEqBase.AbstractMonteCarloSolution{T,N}, t=sim[1].t;quantiles=[0.05,0.95]) where {T,N} - m,v = timeseries_point_meanvar(sim,t) - qlow = timeseries_point_quantile(sim,quantiles[1],t) - qhigh = timeseries_point_quantile(sim,quantiles[2],t) + if typeof(sim[1]) <: DiffEqBase.DESolution + m,v = timeseries_point_meanvar(sim,t) + qlow = timeseries_point_quantile(sim,quantiles[1],t) + qhigh = timeseries_point_quantile(sim,quantiles[2],t) + else + m,v = timeseries_steps_meanvar(sim) + qlow = timeseries_steps_quantile(sim,quantiles[1]) + qhigh = timeseries_steps_quantile(sim,quantiles[2]) + end + num_monte = length(sim) MonteCarloSummary{T,N,typeof(t),typeof(m),typeof(v),typeof(qlow),typeof(qhigh)}(t,m,v,qlow,qhigh,num_monte,sim.elapsedTime,sim.converged) end