
Re: Standard Deviation Calculation
tramachandran Sep 2, 2018 11:56 PM (in response to NicPickering)6 of 6 people found this helpfulStdDev is the standard deviation over the time range given by
SStDev returns the sample standard deviation.The sample standard deviation of a sample x1, ... xn is equal to
SStDev(x1, x2 [, ... xn]) in PI Analytics takes arguments x1, ... xn
Arguments and a single array of same value type (integers and real numbers, time expressions, or time intervals)
About entering values, if you have PI AF 2018+ this becomes easy by invoking RecordedValues or other array functions as an input.
If this is a oneoff calculation you could you AF Explorer, right click on the attribute, Time Series
This can be programmatically achieved in AF SDK through PIPoint.Summaries method and specifying AFCalculationBasis as PopulationStdDev

Re: Standard Deviation Calculation
NicPickering Sep 3, 2018 12:32 AM (in response to tramachandran)Thank you very much for your reply.
Unfortunately I am using an older version of PI and I do not have access to the "recordedvalues" performance equation.Thanks for clearing up which formula is used in the two different equations though!

Re: Standard Deviation Calculation
tramachandran Sep 3, 2018 3:14 AM (in response to NicPickering)1 of 1 people found this helpfulAlso you can try this utility PI DataPipe Events Subscription and Data Access Utility using AF SDK  PIEventsNovo
You get the different summary/summaries calculations(event or time based) of one or more tags as follows without the need to write your own program in AF SDK.

Re: Standard Deviation Calculation
NicPickering Sep 4, 2018 5:52 AM (in response to tramachandran)That is literally everything I need. You are a life saver! Thank you so much!
<3 <3 <3



Re: Standard Deviation Calculation
HuguesStefanski Jan 15, 2019 10:03 AM (in response to tramachandran)I tried the above formula using the following dataset:
070119 07:15:20.000 5.816408634 070119 07:15:50.000 5.578666687 070119 07:16:20.000 7.925262451 070119 07:16:50.000 7.81931448 070119 07:17:20.000 8.726291656 070119 07:17:50.000 10.70085144 070119 07:18:20.000 11.28129578 070119 07:19:20.000 13.947402 070119 07:19:50.000 14.01028252 The value returned by PI DataLink (or Summaries in code) is 2.958836898; however, computing it manually gives 2.97755346. Any idea where the difference might be coming from?

Re: Standard Deviation Calculation
tramachandran Jan 15, 2019 3:39 PM (in response to HuguesStefanski)What do the calculations on each of them correspond? TimeWeighted or EventWeighted?
KB01585  How TimeWeighted and EventWeighted Totals and Averages Work

Re: Standard Deviation Calculation
HuguesStefanski Jan 16, 2019 9:48 AM (in response to tramachandran)Oooh did not think about that. It is timeweighted. The eventweighted value is 3.153877179. I might also add that the data set provided does not comprise the interpolated values at bounds of the interval, nor does the recomputed standard deviation. Including these interpolated values lead to 3.321121824.


