jrsofsd

Running Statistics - Standard Deviation, Variance, Mean

1 post in this topic

#1 ·  Posted (edited)

RunningStats calculates running (moving) statistics: Standard Deviation, Variance, and Mean . The single function _RunningStats(), queries, clears, restores, or adds to the running statistics.

Example.au3 adds 7 samples of data to running statistics and displays the results using _ArrayDisplay().

Example-Persistent-Storage.au3 adds the first 6 samples to the running statistics and stores the results in an INI file. The data is read from the INI file and restored to the running statistics. The 7th sample is added and the results displayed, matching the results from Example.au3.

Credits: John D. Cook for his article "Accurately computing running variance" at http://www.johndcook.com/blog/standard_deviation/

RunningStats.zip

Edited by jrsofsd

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • scintilla4evr
      Advanced Math UDF
      By scintilla4evr
      I started writing this UDF a while ago, so I decided to share it here.
      This is an UDF full of advanced mathematical functions. It allows to work with primes, create number sequences, interpolate, calculate values of functions like Riemann zeta.
      Full list of functions:
       
      Changelog:
      Download
    • Katie_Deely
      Autoit and huge numbers
      By Katie_Deely
      Hey there
      I'm thinking about making a program that will calculate with huge numbers. Well above 1*10^18 probably. Can autoit deal with that? If not, how can I make it work?
      Thanks!
    • rm4453
      Can't Get += to work properly...
      By rm4453
      I keep getting error : Statement cannot be just an expression.
      Here are the 3 error variations it gives:
      Global $ImageCount += 1
      ~~~~~~~~~~~~~~~~~~~~~^
      Global $ImageCount += 1
      ~~~~~~~~~~~~~~~~~~~~^
      Global $ImageCount +=
      ~~~~~~~~~~~~~~~~~~~^
      Here is the code:
      Case $Image1 ;GUICtrlSetState($Image1, 4+128) GUICtrlSetState($Image2, 64) $Image1_done = 1 OpenImages() Global $Image1_added = $imagePath ;MsgBox("Info", "Image 1 Path", $Image1_added) OpenEditBox() Global $Image1_Description = $editBox_save If $im1 = 0 Then Global $ImageCount += 1 $im1 = 1 EndIf Case $Image2 If $Image1_done = 1 Then ;GUICtrlSetState($Image2, 4+128) GUICtrlSetState($Image3, 64) OpenImages() Global $Image2_added = $imagePath ;MsgBox("Info", "Image 2 Path", $Image2_added) OpenEditBox() Global $Image2_Description = $editBox_save $Image2_done = 1 If $im2 = 0 Then Global $ImageCount += 1 $im2 = 1 EndIf Else EndIf Case $Image3 If $Image2_done = 1 Then ;GUICtrlSetState($Image3, 4+128) GUICtrlSetState($Image4, 64) OpenImages() Global $Image3_added = $imagePath ;MsgBox("Info", "Image 3 Path", $Image3_added) OpenEditBox() Global $Image3_Description = $editBox_save $Image3_done = 1 If $im3 = 0 Then Global $ImageCount += 1 $im3 = 1 EndIf Else EndIf Case $Image4 If $Image3_done = 1 Then ;GUICtrlSetState($Image4, 4+128) GUICtrlSetState($Image5, 64) OpenImages() Global $Image4_added = $imagePath ;MsgBox("Info", "Image 4 Path", $Image4_added) OpenEditBox() Global $Image4_Description = $editBox_save $Image4_done = 1 If $im4 = 0 Then Global $ImageCount += 1 $im4 = 1 EndIf Else EndIf Case $Image5 If $Image4_done = 1 Then ;GUICtrlSetState($Image5, 4+128) GUICtrlSetState($Image6, 64) OpenImages() Global $Image5_added = $imagePath ;MsgBox("Info", "Image 5 Path", $Image5_added) OpenEditBox() Global $Image5_Description = $editBox_save $Image5_done = 1 If $im5 = 0 Then Global $ImageCount += 1 $im5 = 1 EndIf Else EndIf Case $Image6 If $Image1_done = 1 Then ;GUICtrlSetState($Image6, 4+128) OpenImages() Global $Image6_added = $imagePath ;MsgBox("Info", "Image 6 Path", $Image6_added) OpenEditBox() Global $Image6_Description = $editBox_save If $im6 = 0 Then Global $ImageCount += 1 $im6 = 1 EndIf Else EndIf  
    • Armand
      Area calculation
      By Armand
      Hi,
      I've attached an example picture of a shape which i would like to calculate it's area. Let's say a user has marked this kind of shaped area on the screen and you need to run some calculations on it, like getting the area of it.
      - How would you go about this problem?
      Thanks in advance

    • darkshark
      Math Worksheet Generator
      By darkshark
      Hi, everybody!
      i'm trying to make a math worksheet generator for kids, but i need it in this format:



      and generate a PDF file with the math problems....
      i know how to generate a problems, but idk how to 'format' this
      anyone have a ideia how to make this?
       
      Thanks a lot.
       
      p.s: Here is my sum generator code:
      Func _Sum_Generator($iMin, $iMax, $iProblems = 100, $iMaxAddends = 2, $bRandomAddends = True, $bUseDecimal = False, $bUseNegative = False) Local $aGenerated[$iProblems][2] If $iMaxAddends < 2 Then $iMaxAddends = 2 For $i = 0 To $iProblems -1 $aGenerated[$i][1] = 0 $iAddends = $iMaxAddends -1 If ($bRandomAddends And $iMaxAddends > 2) Then $iAddends = Random(2, $iMaxAddends, 1) -1 For $j = 0 To $iAddends Local $iOnlyInt = 1, $Negative = 0 If $bUseDecimal Then $iOnlyInt = Random(0,1,1) If $bUseNegative Then $Negative = Random(0,1,1) Local $iRandom = Round(Random($iMin, $iMax, $iOnlyInt), 2) If $Negative Then $iRandom *= -1 If $j = $iAddends Then $aGenerated[$i][0] &= String($iRandom) & " = " Else $aGenerated[$i][0] &= String($iRandom) & " + " EndIf $aGenerated[$i][1] += $iRandom Next Next Return $aGenerated EndFunc