Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Compute Eigenvector Centrality

    Dear Statalisters,

    Please find attached the formula (I could not type formula here ) for Eigenvector centrality of node i as Ci

    I have matrix A and computed lambda (eigenvalue) and eigenvector C,

    I want to ask how to compute the Eigenvector centrality Ci , i.e. to sum over all the product of Aij *Cj for each i, and i not equal to j.

    Thank you,

    Rochelle
    Attached Files

  • #2
    Unless centrality and eigenvector is the same thing (which is not) don't use the same letter (C) to denote both.
    Post formula as an image: Not every mobile phone has MSWord installed on it.
    The way I see it, the problem is not to sum something over something, the problem is to solve a system of linear equations (your Ci-s depend on Cj-s, which creates recursive definition). You have n equations and n+1 unknowns (lambda is the plus one). You say you have lambda, good, then it is n linear equations and n unknowns. Should be a unique solution.
    Sergiy.

    Comment


    • #3
      The -netsis- package (package st0248 from http://www.stata-journal.com/) includes the calculation of eigenvector centrality among its many network analysis features. I have not used this package, but perhaps it might solve the problem here.

      Regards,
      Mike Lacy

      Comment


      • #4
        If you type search centrality, you'll find Hirotaka Miura's library for network analysis. I believe that includes a function to compute eigenvector centrality. Also, if you want to enter math in your posts, you may do so using MathJax.
        Last edited by Phil Schumm; 26 Apr 2014, 08:07.

        Comment


        • #5
          Many thanks to Sergiy, Mike and Phil !!! I downloaded google doc from Hirotaka Miura's website and will see if I can figure out how his ado file works.

          By the way, Sergiy, do you have some reference on how to solve the n linear equation in stata?

          Warm regards,

          Rochelle

          Comment


          • #6
            Originally posted by Rochelle Zhang View Post
            By the way, Sergiy, do you have some reference on how to solve the n linear equation in stata?
            Hm, this tutorial suggests that inverting the matrix of coefficients might be the key.
            Stata has a bunch of tools to do that.
            Best, Sergiy

            Comment


            • #7
              Hi Sergiy,
              I just saw your last posting. The link to "bunch of tools" is not working. Do you mind resending it?

              Thanks a lot,

              Rochelle

              Comment


              • #8
                Rochelle,

                I can't read your Word document, so I don't know if the following applies to your situation or not...

                In general, solving a system of n linear equations in n unknowns is very easy using matrices. As outlined in the tutorial Sergiy posted if you have equations in the form:

                a1x + b1y + c1z + ... = d1
                a2x + b2y + c2z + ... = d2
                ...

                anx + bny + cnz + ... = dn


                and you set up to matrices A and B, such that A is a square matrix containing the a, b, and c coefficients, and B is an nx1 matrix contain the d coefficients, then the solution (values of x, y, and z) can be found using one of the solvers Sergiy tried to link to. In this particular case (square matrix), the best choice is the lusolve() function:

                Code:
                : X=lusolve(A,B)
                You can find information about the other solvers in the M-4 "Solvers" section of the Mata Reference Manual. Note that you can also solve this system of equations using X=A-1B, but the manual recommends against computing the inverse of A, as the method used by lusolve() is more efficient.

                Regards,
                Joe

                Comment


                • #9
                  Originally posted by Rochelle Zhang View Post
                  Hi Sergiy,
                  I just saw your last posting. The link to "bunch of tools" is not working. Do you mind resending it?

                  Thanks a lot,

                  Rochelle
                  http://www.stata.com/manuals13/m-4solvers.pdf

                  Comment

                  Working...
                  X