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
At the top, click the Services section of scts_thing.
In the Ihnerited Services section, you will see the built-in services of the Statistical Calculation Thing Shape. These services can perform a variety of analytical calculations.
The Statistical Calculation Thing Shape can only perform analytics operations on time-series datasets. However, accessing a time-series Value Stream can have a performance hit on the system.
Instead, a Property with an Info Table using a timestamp/value Data Shape is used as the universal input to each built-in service of the Statistical Calculation Thing Shape.
For efficiency, we only reference the Value Stream once to create a formatted timedValues that is used as an input to all other service calls.
In the Javascript field, copy and past the following code:
me.timed_values = me.QueryTimedValuesForProperty({ propertyName: "numbers", maxItems: 10, startTime: me.start_time, endTime: me.end_time });
Now that the numbers, start_time, end_time, and timed_values service inputs have been set, you can use the built-in Services of the Statistical Calculation Thing Shape to perform a variety of analytics calculations.
First, you will utilize the built-in CalculateMeanValue service.
The dataset is the following: 1, 5, 9, 5, 9, 1, 9.
As such, the mean should be (1+5+9+5+9+1+9)/7 = 39/7 = 5.571...
In the Javascript code section, copy and paste the following:
me.mean_result = me.CalculateMeanValue({ timedValues: me.timed_values });
At the top, click Save and Continue.
Next, you will utilize the built-in CalculateMedianValue service.
With our dataset having 5 as the middle value, that should be the result.
In the Javascript code section, copy and paste the following:
me.median_result = me.CalculateMedianValue({ timedValues: me.timed_values });
At the top, click Save and Continue.
You will now utilize the built-in CalculateModeValue service.
With the dataset having 9 as the most common value, that should be the result.
In the Javascript code section, copy and paste the following:
me.mode_result = me.CalculateModeValue({ timedValues: me.timed_values });
At the top, click Save and Continue.
Lastly, you will utilize the built-in CalculateStandardDeviationValue service.
There are multiple free Standard Deviation calculators to check the answer.
Accordingly, the Standard Deviation should be 3.59894...
In the Javascript code section, copy and paste the following:
me.standarddev_result = me.CalculateStandardDeviationValue({ timedValues: me.timed_values });
At the top, click Save and Continue.
The Mean, Median, Mode, and Standard Deviation services you have completed are just a sampling of what the Statistical Calculation Thing Shape offers.
Below is a table of additional built-in services:
Calculation | Service Name | Description |
Binned Data Distribution for Bin Size | CalculateBinnedDataDistributionForBinSize | Calculate the binned distribution of data points based on the desired bin size. |
Binned Data Distribution for Number of Bins | CalculateBinnedDataDistributionForNumberOfBins | Calculate the binned distribution of data points based on the desired number of bins. |
Confidence Interval Values | CalculateConfidenceIntervalValues | Confidence Interval Values Based on a specified confidence interval percentage, calculate the minimum, median, and maximum interval values. |
Five Number Property Values | CalculateFiveNumberPropertyValues | Calculate the five number values: minimum, lower quartile, median, upper quartile, and maximum. |
Fourier Transform | CalculateFourierTransform | Calculate the results of running the fast Fourier transform on the specified values. |
Maximum Value | CalculateMaximumValue | Calculate the maximum property value in the provided infotable. |
Minimum Value | CalculateMinimumValue | Calculate the minimum property value in the provided infotable. |
Sampling Frequency Values | CalculateSamplingFrequencyValues | Calculate the sampling frequency values: minimum, median, and maximum. |
Congratulations!
In this guide, you have learned how to:
We recommend the following resources to continue your learning experience:
Capability | Guide |
Build | Build a Predictive Analytics Model |
Build | Operationalize an Analytics Model |
If you have questions, issues, or need additional information, refer to:
Resource | Link |
Community | Developer Community Forum |
Support | Descriptive Analytics Help Center |