Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
add summary path for array outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jul 29, 2018
1 parent 8a1d3ba commit 090b9a2
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 090b9a2

Please sign in to comment.