Jump to content
  • To Search the Seeq Knowledgebase:

    button_seeq-knowledgebase.png.ec0acc75c6f5b14c9e2e09a6e4fc8d12.png.4643472239090d47c54cbcd358bd485f.png

Search the Community

Showing results for tags 'standard deviation'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Community Technical Forums
    • Tips & Tricks
    • General Seeq Discussions
    • Seeq Data Lab
    • Seeq Developer Club
    • Seeq Admin Forum
    • Feature Requests

Calendars

  • Community Calendar

Categories

  • Seeq FAQs
  • Online Manual
    • General Information

Categories

  • Published
  • Code
  • Media

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Company


Title


Level of Seeq User

Found 4 results

  1. There are times when you may need to calculate a standard deviation across a time-range using the data within a number of signals. Consider the below example. When a calculation like this is meaningful/important, the straightforward options in Seeq may not be mathematically representative to calculate a comprehensive standard deviation. These straightforward options include: Take a daily standard deviation for each signal, then average these standard deviations Take a daily standard deviation for each signal, then take the standard deviation of the standard deviations Create a real-time standard deviation signal (using stddev($signal1, $signal2, ... , $signalN)), then take the daily average or standard deviation of this signal While straightforward options may be OK for many statistics (max of maxes, average of averages, sum of totalizes, etc), a time-weighted standard deviation across multiple signals presents an interesting challenge. This post will detail methods to achieve this type of calculation by time-warping the data from each signal then combining each individually warped signal into a single signal. Similar methods are also discussed in the following two seeq.org posts: Two different methods to arrive at the same outcome will be explored. Both of these methods share the same Step 1 & 2. Step 1: Gather Signals of Interest This example will consider 4 signals. The same methods can be used for more signals, but note that implementing this solution programmatically via Data Lab may be more efficient when considering a high number of signals (>20-30). Step 2: Create Important Scalar Constants and Condition Number of Signals: The number of signals to be considered. 4 in this case. Un-Warped Interval: The interval you are interested in calculating a standard deviation (I am interested in a Daily standard deviation, so I entered 1d) Warped Interval: A ratio calculation of Un-Warped Interval / Number of Signals. This metric is detailing what the new time-range will be for the time-warped signals. I.e. given I have 4 signals considering a days worth of data of, each signal's day worth of data will be warped into 6 hour intervals Un-Warped Periods: This creates a condition with capsules spanning the original periods of interest. periods($unwarped_interval) Method 1: Create ONE Time-Shift Signal, and move output Warped Signals The Time Shift Signal will be used as a counter to condense the data in the period of interest (1 day for this example) down to the warped interval (6 hours for this example). 0-timeSince($unwarped_period, 1s)*(1-1/$num_of_signals) The next step is to use this Time Shift Signal to move the data within each signal. Note there is an integer in this Formula that steps with each signal applied to. Details can be viewed in the screenshots. $area_a.move($time_shift_signal, $unwarped_interval).setMaxInterpolation($warped_interval).move(0*$warped_interval) The last step is to combine each of these warped signals together. We now have a Combined Output that can be used as an input into a Daily Standard Deviation that will represent the time-weighted standard deviation across all 4 signals within that day. Method 2: Create a Time-Shift Signal per each Signal - No Need to move output Warped Signals This method takes advantage of 4 time-shift signals, one per signal. Note there is also an integer in this Formula that steps with each signal applied to. Details can be viewed in the screenshot. These signals take care of the data placement, where-as the data placement was taken care of using .move(N*$warped_interval) above. 0*$warped_interval-timeSince($unwarped_period, 1s)*(1-1/$num_of_signals) We can then follow Method 1 to use the time shift signals to arrange our signals. We just need to be careful to use each time shift signal, as opposed to the single time shift signal that was created in Method 1. As mentioned above, there is no longer a .move(N*$warped_interval) needed at the end of this formula. The last step is to combine each of these warped signals together, similar to Method 1. $area_a.move($time_shift_1, $unwarped_interval).setMaxInterpolation($warped_interval) Comparing Method 1 and Method 2 & Calculation Outputs The below screenshot shows how Methods 1 & 2 arrive at the same output Note the difference in calculated values. The Methods reviewed in this post most closely capture the true time-weighted standard deviation per day across the 4 signals. Caveats and Final Thoughts While this method is still the most mathematically correct, there is a slight loss in data at the edges. When combining the data in the final step, the beginning of $signal_2 falls at the end of $signal_1, and so on. There are some methods that could possibly address this, but this loss in samples should be negligible to the overall standard deviation calculation. This method is also heavy on processing, especially depending on the input signals' data resolution and as the overall number of signals being considered increases. It is most ideal to use this method if real-time results are not of high importance, and better fitting if the calculation outputs are input in an Organizer that displays the previous day's/week's/etc results.
  2. I have a can line, that can handle 3 types of can sizes.... 400gr, 850gr and 900gr. I have created a capsule, based on HI / LO limites (set in Asset Framework) and the CanSetpoint Now I want to calculate the standard deviation of the can weight. These are individual measurements and the timing depends on the line speed (unknown) I want to know the 10 minutes rolling standard deviation fill weight, within a capsule. So start capsule 400gr can - xx amount of can - time 00:00:00 till 00:10:00 - STD 1 minute later: 400gr can - xx amount of can - time 00:01:00 till 00:11:00 - STD etc... Suggestions ...?
  3. FAQ: I've got a signal for which the average and standard deviation are believed to be drifting over time. When I view the average and standard deviation in calendar time, it isn't helpful because they are highly dependent upon the production grade that I am running. Is there a better way that I could be viewing my data to get a sense of the drift of the average and standard deviation by production grade over time? Solution 1: Histogram 1. Add your signal of interest and your production grade code signal to the display. 2. Create a condition for all production grades using formula: $gradeCode.toCondition() 3. Use the Histogram tool to calculate the average reactor temperature during each grade campaign and display them aggregated over production grade, and time. The same methods from step 3 can be applied to get a second histogram of the distribution of the standard deviation of the signal of interest by grade over time. Solution 2: Chain View 1. Add your signal of interest and your operating state signal to the display. 2. Use Formula to create a condition for all operating states: $stateSignal.toCondition() 3. Use the Signal from Condition tool to calculate the average temperature over the all operating states condition. 4. Use the Signal from Condition tool to calculate the standard deviation of temperature over the all operating states condition. 5. Use Formula to calculate two new signals for “Avg + 2 SD” and “Avg – 2 SD”. 6. Filter your all operating states condition for only the state that you are interested in viewing. In this example we want to view only the capsules during which the compressor is in stage 2, for which the syntax is: $AllOperatingStates.removeLongerThan(7d).removeShorterThan(4h).filter($capsule -> $capsule.getProperty('Value').isEqualTo('STAGE 2')) This formula is taking our condition for all operating states, keeping only capsules that are between 4h and 7d in length, then filtering those capsules to include only those for which the value is equal to stage 2. 7. Swap to chain view and view a longer time range.
  4. Use Case Background Commonly, engineers are interested in calculating limits on a signal based upon the average and standard deviation. Additionally, there may be different modes of operation during which the performance - and limits - is different. This post describes how to develop mode based boundaries for a process signal to identify deviations from the normal or expected behavior. Mode Conditions In this example, I am interested in calculating boundaries on a Compressor Power signal based upon the mode of operation in a Compressor Stage Signal. (Note: These signals are from Example>Cooling Tower 1> Area A of the Example data shipped with each Seeq installation.) The first step is to identify the 3 stages of operation (Off, Running 1 Compressor, Running 2 Compressors) by performing a Value Search on the Compressor Stage signal: Average Compressor Power using Formula Next, I can use the Formula tool to calculate an Average Compressor Power signal, using the following variables and syntax: Variables Name Item Type $Series Compressor Power Signal $High Compressor High Condition $Low Compressor Low Condition $Off Compressor Off Condition Formula // Identify a reference capsule over which the statistic is calculated. You can think of this as the golden batch period or the period in time that we know that the system was operating properly. $refPeriod = capsule("2016-04-01T00:00:00Z","2016-05-01T00:00:00Z") //Cut the single continuous time series signal (Compressor Power) into sections which correspond to the different modes of operation. This gives us three intermediate time series signals which only contain data for the three distinct modes of operation. $highSeries = $series.within($high) $lowSeries = $series.within($low) $offSeries = $series.within($off) // Create three intermediate time series signals, one for each mode of operation. Find the average value of the time series signal during the reference time period for each mode of operation, and then turn that scalar into a time series signal which only exists in the appropriate mode of operation $highAve = $highSeries.average($refPeriod).tosignal().within($high) $lowAve = $lowSeries.average($refPeriod).tosignal().within($low) $offAve = $offSeries.average($refPeriod).tosignal().within($off) // Splice together the three time series signals into a single signal and step interpolate the $finalSeries $finalSeries = $highAve.splice($lowAve,$low,false).splice($offAve,$off,false).toStep() return $finalSeries Boundaries Using Formula To start, let's calculate the upper boundary as the average + 3 std dev. I can use the Formula tool to calculate this upper boundary using the following variables and syntax. Variables Name Item Type $Series Compressor Power Signal $High Compressor High Condition $Low Compressor Low Condition $Off Compressor Off Condition Formula $refPeriod = capsule("2016-04-01T00:00:00Z","2016-05-01T00:00:00Z") $highSeries = $series.within($high) $lowSeries = $series.within($low) $offSeries = $series.within($off) $highAve = $highSeries.average($refPeriod).tosignal().within($high) $highStdDev = $highSeries.standarddeviation($refPeriod).tosignal().within($high) $highBoundary = $highAve + $highStdDev*3 $lowAve = $lowSeries.average($refPeriod).tosignal().within($low) $lowStdDev = $lowSeries.standarddeviation($refPeriod).tosignal().within($low) $lowBoundary = $lowAve + $lowStdDev*3 $offAve = $offSeries.average($refPeriod).tosignal().within($off) $offStdDev = $offSeries.standarddeviation($refPeriod).tosignal().within($off) $offBoundary = $offAve + $offStdDev*3 $finalSeries = $highBoundary.splice($lowBoundary,$low,false).splice($offBoundary,$off,false).toStep() return $finalSeries Similarly, I can calculate the lower boundary as average - 3 std dev using the following variables and Formula syntax. Variables Name Item Type $Series Compressor Power Signal $High Compressor High Condition $Low Compressor Low Condition $Off Compressor Off Condition Formula $refPeriod = capsule("2016-04-01T00:00:00Z","2016-05-01T00:00:00Z") $highSeries = $series.within($high) $lowSeries = $series.within($low) $offSeries = $series.within($off) $highAve = $highSeries.average($refPeriod).tosignal().within($high) $highStdDev = $highSeries.standarddeviation($refPeriod).tosignal().within($high) $highBoundary = $highAve - $highStdDev*3 $lowAve = $lowSeries.average($refPeriod).tosignal().within($low) $lowStdDev = $lowSeries.standarddeviation($refPeriod).tosignal().within($low) $lowBoundary = $lowAve - $lowStdDev*3 $offAve = $offSeries.average($refPeriod).tosignal().within($off) $offStdDev = $offSeries.standarddeviation($refPeriod).tosignal().within($off) $offBoundary = $offAve - $offStdDev*3 $finalSeries = $highBoundary.splice($lowBoundary,$low,false).splice($offBoundary,$off,false).toStep() return $finalSeries Final Results Executing these 3 formulas results in 3 new time series signals: Average Compressor Power, Compressor Power +3sd and Compressor Power -3sd. The Customize menu in the Details Pane can be used to adjust how these signals are visualized on the screen: Content Verified DEC2023
×
×
  • Create New...