Skip to content

Commit

Permalink
fix calculation of morans I
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasmueboe committed Aug 25, 2024
1 parent 9749138 commit 8996447
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/spatialPCA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ function varianceMoransIdecomposition(M::SpatialPCA, X)
laggedX = transformedX * M.W
w = 1 / size(M.W, 1) # sum of row_weights but because its normed the sum is n
variance = sum(transformedX .* transformedX .* w; dims=2)
moransI = sum(transformedX .* laggedX; dims=2) ./ variance # TODO ?
moransI = sum(transformedX .* laggedX .* w; dims=2) ./ variance # TODO ?
return variance, moransI
end

Expand Down

2 comments on commit 8996447

@niklasmueboe
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/113817

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.0 -m "<description of version>" 899644790aa60669cdf5c5a079c1c0b567ec37d2
git push origin v0.1.0

Please sign in to comment.