# Why does LightGraphs.katz\_centrality give negative centrality scores?

**URL:** <https://discourse.julialang.org/t/why-does-lightgraphs-katz-centrality-give-negative-centrality-scores/21204>\
**Category:** Modelling & Simulations\
**Tags:** question\
**Created:** [February 26, 2019, 8:32am UTC](https://discourse.julialang.org/t/why-does-lightgraphs-katz-centrality-give-negative-centrality-scores/21204 "2019-02-26T08:32:48Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ennvvy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ennvvy/32/7816_2.png) [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Post date:** [February 26, 2019, 8:32am UTC](https://discourse.julialang.org/t/why-does-lightgraphs-katz-centrality-give-negative-centrality-scores/21204/1 "2019-02-26T08:32:48Z")

</div>

I am using Katz\_centrality to determine the centrality measures for nodes in the network Julia 1.1.0. However, it yields negative values. Shouldn’t centrality scores be positive ?

---

<div class="post-metadata">

**Author:** ![Carl\_Love](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carl_love/32/13482_2.png) [@Carl\_Love](https://discourse.julialang.org/u/Carl_Love)\
**Post date:** [March 18, 2020, 3:40am UTC](https://discourse.julialang.org/t/why-does-lightgraphs-katz-centrality-give-negative-centrality-scores/21204/2 "2020-03-18T03:40:29Z")

</div>

In order for the Katz results to be valid, the attenuation factor must be a positive number smaller than the maximum of the absolute values of the eigenvalues of the adjacency matrix. You will very likely get negative if you use a larger factor. It’s just like summing an infinite geometric series using the formula 1/(1-r): It’s only valid if abs(r) \< 1.
