Announcement

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

  • How are stats in the forum computed?

    While looking at user profiles I was puzzled to understand how some stats are computed on the users' pages.
    For example, I wonder how posting 3 posts in 2 days may result in 2.22 posts per day? Is it hourly prorated? Or is there some decay function weighting the more recent data?

    Thank you, Sergiy Radyakin




    Attached Files

  • #2
    I can think of various hypotheses. The software can't calculate 3/2 correctly. The software is not dividing by 2, but by days with fractional parts. The software is using seasonal Holt-Winters exponential smoothing. This was Sergiy's April Fool joke. I will put all my bets on the second.

    Comment


    • #3
      Nick,
      1. if it divided by days with fractional parts, then the first post immediately after joining the forum would result in the post rate of hundreds of posts per day, which we do not observe for any forum user.
      2. this is not a 04.01 joke, but if you doubt the screenshot, you can check it on your own forum user page.
      3. Holt-Winters is exactly what I was thinking about, but it is not described anywhere. Observing for a few more days should make this apparent.
      4. Another possibility is that short posts are not counted as posts, long posts are counted as multiple posts, code blocks are counted as separate posts, or (unlikely) your first hypothesis, in which case it needs to be fixed.
      As a second question on the forum inner workings I am interested how the "users online" is constructed. And whether logging in simultaneously from multiple devices is permitted/counted?

      Best, Sergiy Radyakin

      Comment


      • #4
        OK; I don't know. Perhaps you need to hack the source code.

        Comment


        • #5
          My guess would be that it's dividing by days with fractional parts for days>=1 but not for the first day. Using fractional days seems a strange level of precision for this sort of calculation, but it makes more sense to me than the other options.

          (And now I will go see what my average is now that I've posted something).

          Comment


          • #6
            Originally posted by Sarah Edgington View Post
            My guess would be that it's dividing by days with fractional parts for days>=1 but not for the first day. Using fractional days seems a strange level of precision for this sort of calculation, but it makes more sense to me than the other options.

            (And now I will go see what my average is now that I've posted something).
            Sarah has it exactly right.

            The code essentially is

            Code:
            time_elapsed = (now - userjoindate) / (24 * 60 * 60) ;
            if (time_elapsed < 1) {
                postsperday = Nuserposts ;
            }
            else {
               sprintf(postsperday, "%.2f", Nuserposts / time_elapsed) ;
            }
            If you have been participating less than 24 hours, your posts per day will be however many posts you have made. If you have been participating at least 24 hours, your posts per day are calculated using fractional days.

            Comment


            • #7
              Thank you, Alan.

              Comment

              Working...
              X