One more question on manual computing of statistics… it is “trivial” to compute the mean, the median, and the std, e.g.:
sol_a = Array(sol)
sol_mean = mean(sol_a; dims=3)[:,:,1] |> permutedims
sol_median = median(sol_a; dims=3)[:,:,1] |> permutedims
sol_std = std(sol_a; dims=3)[:,:,1] |> permutedims
plot(sol_mean)
plot!(sol_median)
plot!(sol_mean,ribbon=(sol_std,sol_std))
However – for some reason, function quantile
does not seem to allow for the dims
keyword.
Question: Does this mean that quantile
only accepts vectors as first argument, and that I need to loop through both the number of states (first dimension of sol
, = 3 in my case) and the number of time points (second dimension of sol
, = 111 in my case)? In other words, something like the following:
[quantile(sol_a[i,j,:],0.5) for j in 1:111, i in 1:3]
in my case of 3 states, 111 time points, and the median (0.5 quantile)? Or is there a built-in method that handles dims
?