Jump to content

Aggregate over disjoint capsules


Go to solution Solved by John Cox,

Recommended Posts

Posted

I want to calculate a Ppk value for a signal, allowing certain batches to be excluded from the calculation.  The batches to exclude will be manually designated through user interaction.   I'm implementing the following approach, but am not quite getting the result I anticipated.  Here are signals and conditions I'm using:

 

  • $wot:  (Condition) Work order (batch) timestamps.  Each capsule in this condition has both the start and end timestamp set to the completion time of the associated batch.  
  • $sr: (Condition) This is a condition with a single capsule that spans all of the capsules in $wot
  • $wote: (Condition) A manual condition where users select capsules from $wot to designate to be excluded from the Ppk calculation.  Note that this condition will always have one capsule in it that does not overlap $sr.  This makes the formula below work nicely.
  • $woti: (Condition) A composite condition, which is simply: $sr minus $wote
  • $apbr: (Signal)  Average-per-batch signal, which has a sample at each of the $wot capsules.  This is a discrete signal.  

To calculate Ppk, I create a new formula signal using the following formula:
 

$apbrAvg = $apbr.aggregate(average(), $woti, endKey())
$apbrStdDev = $apbr.aggregate(stdDev(), $woti, endKey())

$ppu = ($usl - $apbrAvg) / (3 * $apbrStdDev)
$ppl = ($apbrAvg - $lsl) / (3 * $apbrStdDev)

min($ppu, $ppl)

When $wote contains no capsules that overlap $sr, I get exactly what I expect.   A single value for Ppk.  When I start adding some capsules from $wot to $wote, then $woti will have multiple, non-overlapping capsules.  This results in a Ppk value per capsule.  

After rereading the documentation for aggregate, this is the expected behavior.  How can I accomplish what I intended?  That is, compute a single Ppk value where the underlying $apbrAvg and $apbrStdDev are the average and standard deviation for all of the values from $apbr that intersect $woti?

  • Seeq Team
  • Solution
Posted
Hi Ben,

Please try these modifications in your formula and see if it helps. 

// remove the average per batch values that fall within capsules to exclude,
// prior to doing the aggregation over the entire $sr capsule
$apbrAvg = $apbr.remove($wote).aggregate(average(), $sr, endKey())
$apbrStdDev = $apbr.remove($wote).aggregate(stdDev(), $sr, endKey())

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
×
×
  • Create New...