I would like to understand how I can take the geometric mean of an array across a certain dimension. For the mean value, I normally use:
mean(x, dims=1)
But the same does not work for geometric mean, why?
using Statistics
x = [1 2 3 ; 4 5 6]
geomean(x, dims=1)
ERROR: MethodError: no method matching geomean(::Array{Int64,2}; dims=1)
Closest candidates are:
geomean(::Any) at /home/josimar/.julia/packages/StatsBase/548SN/src/scalarstats.jl:16 got unsupported keyword argument "dims"
Stacktrace:
[1] top-level scope at REPL[30]:1
Note that the above error for the geomean
also occurs for the harmmean
and percentile
.