Comments (3)
Hi,
I have no doubt your formulation is clearer than the code currently (which
is directly modeled off of BCT matlab code) but can you point out
explicitly where is the error in parenthesis?
On Tue, Mar 31, 2015 at 5:18 PM, birkantunc [email protected]
wrote:
Hi,
For both assortativity_bin and assortativity_wei, there is a mistake in
calculation of "r"Right formulation is
term1 = np.sum(degi
degj)/K term2 = np.square(np.sum(.5(degi+degj))/K)
term3 = np.sum(.5_(degi_degi+degj*degj))/K
r = (term1 - term2) / (term3 - term2)for binary and
term1 = np.sum(stri
strj)/K term2 = np.square(np.sum(.5(stri+strj))/K)
term3 = np.sum(.5_(stri_stri+strj*strj))/K
r = (term1 - term2) / (term3 - term2)for weighted matrices.
Regards,
Birkan—
Reply to this email directly or view it on GitHub
#7.
from bctpy.
Hi,
Sorry for not giving the details.
In the original form it is
r=(( np.sum(degi_degj)/K - np.square(np.sum(.5_(degi+degj))/K)) /
np.sum(.5_(degi_degi+degj_degj))/K - np.square(sum(.5_(degi+degj))/K))
It should be
r=( np.sum(degi_degj)/K - np.square(np.sum(.5_(degi+degj))/K)) /
(np.sum(.5_(degi_degi+degj_degj))/K - np.square(sum(.5_(degi+degj))/K))
i.e. first parenthesis should be moved to the beginning of the denominator. The correct form is
(t1 - t2) /(t3 - t4)
but currently it is
((t1 - t2) / t3 - t4)
Thus, results are not in the range of [-1, 1] as it should be. Again, since always t4 = t2, you do not need to calculate it twice.
from bctpy.
You are right, thanks.
from bctpy.
Related Issues (20)
- NBS incorrectly(?) lumps positive and negative effects together
- B symmetrization inside if statement in community_louvain
- IndexError: index 2278 is out of bounds for axis 0 with size 2278 HOT 3
- bug: findwalks's for loop index is wrong at it's onset HOT 1
- Wrong description in `kcoreness_centrality_bu` HOT 1
- Update `get_rng` to return Generator instances
- Different implementations to compute global efficiency using bct.charpath and bct.efficiency_wei unclear HOT 1
- Does bct.efficiency_wei also work for directed networks? HOT 1
- Improve generalizability of partition_distance()
- No fucntion get_components.py inside module .algorithms? HOT 1
- Autofix(): Indexing error
- Issue with weighted transitivity and clustering coefficient? HOT 1
- Problem to run bct.modularity_dir with latest numpy HOT 1
- bct.charpath does not exclude 'Infs' in the distance matrix as mentioned in the documentation HOT 1
- Permutation max = 0 at stringent t-thresholds
- Official `bctpy` on `conda-forge` HOT 7
- local_assortativity_wu_sign not separating signs properly
- NBS covariates
- NBS parallel
- Release 0.6.1 missing tar.gz on Pipy HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bctpy.