Created
August 25, 2014 01:00
-
-
Save milktrader/8919439db67bc5783cbb to your computer and use it in GitHub Desktop.
Minkowski criterion function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
julia> function L(c) | |
sum([abs(xs-c)^2 for xs in x])/length(x) | |
end | |
L (generic function with 2 methods) | |
julia> x=[1,2,3,4,5,6,9,12] | |
8-element Array{Int64,1}: | |
1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
9 | |
12 | |
julia> mean(x) | |
5.25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First though
L
needs to be defined better