cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily. X

Statistical Monitoring with Descriptive Analytics Part 1

No ratings

 

Use the statistical calculation Thing Shape to execute useful analysis services

 

GUIDE CONCEPT

 

This project will introduce the Statistical Monitoring Thing Shape.

 

This guide demonstrates using Descriptive Analytics from ThingWorx Predictive Analytics to perform common statistical monitoring analysis on time-series data. You will learn to use the Statistical Monitoring ThingShape's built-in services to return the number of values in a data set that are: above or below a threshold, inside or outside a defined range, or following a trend that is: increasing, decreasing, or alternating.

 

IoTProductMgmt_0-1668017907835.png

 

 

YOU'LL LEARN HOW TO

 

  • Create a Thing with the Statistical Monitoring Thing Shape
  • Create a Property and Value Stream to record changes in Property values
  • Use Services that perform Standard Analytical Monitoring

 

NOTE: The estimated time to complete this guide is 30 minutes.

 

 

Step 1: Introduction

 

Descriptive analytics lets you perform common statistical monitoring calculations on changes in a Property value over time.

 

Output from monitoring Services can be used in IoT applications built with ThingWorx to provide trend and numerical limits feedback.

 

This guide introduces the Statistical Monitoring Thing Shape which adds Services to Things and Thing Templates for reporting Property values that are: above or below a threshold, inside or outside a defined range, or following a trend that is: increasing, decreasing, or alternating.

 

IoTProductMgmt_1-1668018077777.png

 

These Services analyze time-series data which is stored in ThingWorx Foundation as changes to a Property value logged to a Value Stream.

 

To ensure optimum performance, both a time range and a maximum number of value changes must be specified.

 

 

Step 2: Create Prerequisites

 

Statistical monitoring Services operate on Property values that change over time. To create this time series data, Property value changes are logged in a Value Stream. In this step, you will create a Value Stream, then a Thing with a Property that logs changes to that Value Stream.

 

Create Value Stream

 

Follow the steps below to create a value stream which you will later tie to a Thing.

 

    1. On the ThingWorx Composer Browse tab, click Data Storage > Value Streams, then click the +New button

 

IoTProductMgmt_2-1668018160892.png

 

    2. Select ValueStream and click OK.

 

IoTProductMgmt_3-1668018160893.png

 

    3. In the Name field, enter scts_valuestream.

 

IoTProductMgmt_4-1668018160895.png

 

    4. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.

 

    5. At the top, click Save.

 

Create Thing

 

Now, you will create a Thing with a property and configure it to use the previously-created value stream. You will also apply the statistical monitoring Thing Shape to the Thing, which makes the built-in analytics services available.

 

    1. On the ThingWorx Composer Browse tab, click MODELING > Things then click the + New button 

 

IoTProductMgmt_5-1668018160896.png

 

    2. In the Name field, enter scts_thing.

 

    3. If Project is not already set, click the + in the Project text box and select the PTCDefaultProject.

 

    4. In the Base Thing Template field, search for and select GenericThing.

 

    5. In the Implemented Shapes field, search for and select StatisticalMonitoringThingShape.

 

    6. In the Value Stream field, search for and select scts_valuestream.

 

IoTProductMgmt_6-1668018160898.png

 

    7. At the top, click Save.

 

 Add Property

 

You will now add a property to scts_thing.

 

    1. At the top, click Properties and Alerts

 

IoTProductMgmt_7-1668018160899.png

 

    2. Click + Add.

 

    3. In the right slide-out's Name field, enter numbers.

 

    4. Change the Base Type to NUMBER.

 

    5. Click Persistent.

 

    6. Click Logged.

 

IoTProductMgmt_8-1668018160901.png

 

    7. Click Advanced Settings to open the bottom panel, in the Data Change Type drop-down select Always.

 

IoTProductMgmt_9-1668018160901.png

 

    8. At the top-right, click the "check" icon for DONE.

 

IoTProductMgmt_10-1668018160902.png

 

    9. At the top, click Save.

 

 

Step 3: Enter Sample Data

 

In this step, you will enter sample data that will illustrate the available Services.

 

This dataset: 2, 3, 4, 3, 2, 2, 1, 2, 1, 1, 2, 3, 3, 4, 3, 2 is shown graphed. 

 

IoTProductMgmt_13-1668019070290.png

 

Enter Data

 

Perform the steps below to enter the above values into the Numbers Property.

 

    1. Under the Value column and on the Numbers property row, click the "pencil" icon for Set value of property.

 

IoTProductMgmt_14-1668019182499.png

 

    2. In the right-side slide-out, enter 2.

 

IoTProductMgmt_11-1668018956019.png

 

    3. At the top-right, click the "check" icon for Done.

 

    4. At the top, click Save.

IoTProductMgmt_12-1668018956026.png

 

    5. Repeat steps 1-4 above, but changing the value each time as per the table below:

 

Value Change CountEntered Value
2nd3
3rd4
4th3
5th2
6th2
7th1
8th2
9th1
10th1
11th2
12th3
13th3
14th4
15th3
16th2

 

 

Step 4: Test Monitoring Services

 

Now that value changes to the numbers Property have been logged in a Value Stream, you can use the built-in Services of the Statistical Monitoring Thing Shape to return how many of values meet different monitoring criteria.

 

Trend Service

 

You will test the built-in GetNumberOfConsecutivePointsFollowingATrend Service. This Service will return how many of points in the largest group of values following one of the three trend types INCREASING, DECREASING, and ALTERNATING.

 

    1. Click the Service tab in the scts_thing Thing.

 

    2. Click the GetNumberOfConsecutivePointsFollowingATrend Service.

 

IoTProductMgmt_0-1668019842772.png

 

    3. In the PropertyName field enter numbers.

 

    4. In the NumberOfPoints field enter 16 to check all entered points.

 

    5. In the Trend field enter INCREASING to find the largest number of points with an increasing trend.

 

    6. Click the green Execute button and note the Result property in the Output panel has the value 6

 

IoTProductMgmt_1-1668019842773.png

 

    7. Repeat the steps above changing the Trend to DECREASING and note the result is 5.

 

IoTProductMgmt_2-1668019842774.png

 

Range Service

 

We'll now test the built-in GetNumberOfPointsBasedOnARange Service. This Service will return the number of points INSIDE or OUTSIDE a range of values specified by a MIN and MAX value.

 

    1. Click the Close button in the Services tab in the scts_thing Thing.

 

    2. Click the GetNumberOfPointsBasedOnARange Service.

 

IoTProductMgmt_3-1668019842776.png

 

    3. In the PropertyName field enter numbers.

 

    4. In the NumberOfPoints field enter 16 to check all entered points.

 

    5. In the Min field enter 1.5 to set the lower end of the range criteria.

 

    6. In the Max field enter 2.5 to set the upper end of the range criteria.

 

    7. In the RegionOfInterest field enter INSIDE to find the largest number of points with an increasing trend.

 

    8. Keep the default IncludeMin and IncludeMax set to True.

 

    9. Click the green Execute button and note the Result property in the Output panel has the value 6.

 

IoTProductMgmt_4-1668019842777.png

 

    10. Repeat the steps above changing the RegionOfInterest to OUTSIDEand note the result is 10.

 

IoTProductMgmt_5-1668019842779.png

 

Threshold Service

 

You will now test the built-in GetNumberOfPointsBeyondAThreshold Service. This Service will return the number of points ABOVE or BELOW a specified value.

 

    1. Click the Services tab in the scts_thing Thing.

 

    2. Click the GetNumberOfPointsBeyondAThreshold Service.

 

IoTProductMgmt_6-1668019842781.png

 

    3. In the PropertyName field enter numbers.

 

    4. In the NumberOfPoints field enter 16 to check all entered points.

 

    5. In the Threshold field enter 3 to set the threshold criteria.

 

    6. In the Direction field enter ABOVE to find the number of points above the threshold value.

 

    7. Keep the default IncludeThreshold set to True.

 

    8. Click the green Execute button and note the Result property in the Output panel has the value 7.

IoTProductMgmt_7-1668019842784.png

 

    9. Repeat the steps above changing the Direction to BELOWand note the result is 14.

 

IoTProductMgmt_8-1668019842784.png

 

 

Click here to view Part 2 of this guide.

Version history
Last update:
‎Mar 07, 2023 08:38 AM
Updated by:
Labels (1)
Contributors