Created
March 17, 2015 20:23
-
-
Save tinybike/c65a3913d57fef428265 to your computer and use it in GitHub Desktop.
centering matrix
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
centering(n::Int) = eye(n) - ones(n) * ones(n)' / n | |
centering{T<:Real}(n::Int, w::Vector{T}) = eye(n) - ones(n) * w' | |
normalize{T<:Real}(v::Vector{T}) = vec(v) / sum(v) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment