# standard deviation Event weighted Standard Deviation per 10 minutes

## Recommended Posts

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 ...?

##### Share on other sites

• Seeq Team

Hi Robin,

I would use a Seeq formula similar to the one below, with the Can Weight signal and your existing Can Production capsules as inputs. The key functions used are aggregate(), periods(), and inside(). Note that you could also do the std deviation calculation using Signal from Condition, using a condition created in Formula with: periods(10min,1min).inside(\$CanProductionCapsules).

\$CanWeightSignal
.aggregate(stdDev(),                                                         // std deviation statistic
periods(10min,1min).inside(\$CanProductionCapsules), // do the calc over 10 min rolling window every minute
// but only for 10 minute capsules fully inside CanProduction capsules
endKey()                        // place the calculation result at the end of the 10 minute window
, 0s)                               // max interpolation between data points, use 0s if you want discrete result

Hope this helps!

John

##### Share on other sites

Thanks for the reply... using the standard deviation, based on Signal from condition is a Time-Weighted STD and this will not work... It should be an event weighted Standard Deviation (each individual can)

I will try your second suggestion....

##### Share on other sites

@John Cox... almost... I found a signal that indicated the production status, independent of the Can Size. This is the right trigger to calculate the STD per can

I decrease the function to calculate it every 5 minutes, 30s

2 things.... can we add a (stepped) line.... and  how we close the gaps... Due to calibrations, every 18 minutes or production interrupts there a gaps in the STD signal... can we fix this... ??

but many thanks for now... getting closer 😉

##### Share on other sites

• Seeq Team

Hi Robin,

1) To answer your earlier question, to avoid the time weighted standard deviation, all you need to do is change the signal to a discrete signal and then apply the same formula:

\$CanWeightSignal.toDiscrete()
.aggregate(stdDev(),                                                         // std deviation statistic
periods(10min,1min).inside(\$CanProductionCapsules), // do the calc over 10 min rolling window every minute
// but only for 10 minute capsules fully inside CanProduction capsules
endKey()                        // place the calculation result at the end of the 10 minute window
, 0s)                               // max interpolation between data points, use 0s if you want discrete result

2) To answer your most recent question, to convert your current result to a stepped signal rather than the discrete results you now have on the trend, you can use a Formula function named .toStep(). Inside the parentheses, you enter the maximum amount of interpolation, the maximum amount of time you want to draw a line connecting your calculated results. For example, the function below sets a maximum interpolation between data points of 8 hours.

.toStep(8hr)

Hope this helps!

John