# Standard Deviation Function missing in Ignition V8.1

**URL:** <https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619>\
**Category:** Ignition\
**Tags:** ignition81, vision\
**Created:** [February 20, 2025, 1:34pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619 "2025-02-20T13:34:19Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Venkatesh](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/venkatesh/32/72855_2.png) [@Venkatesh](https://forum.inductiveautomation.com/u/Venkatesh)\
**Post date:** [February 20, 2025, 1:34pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/1 "2025-02-20T13:34:19Z")

</div>

In one of our projects we're using stdDev function to calculate the standard deviation.Recently We've Upgraded the Ignition version from 7.5 to 8.1.In 8.1version we found the StdDev function is missing form the Math Library. It seems the new function system.math.standardDeviation is used in the latest version is there is any way to use the old function stdDev

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 20, 2025, 1:42pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/2 "2025-02-20T13:42:17Z")

</div>

> [@Venkatesh](#):
>
> In 8.1version we found the StdDev function is missing form the Math Library.

Are you talking about an expression or scripting? Can you provide an example of what was previously working but now does not?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 20, 2025, 5:55pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/3 "2025-02-20T17:55:19Z")

</div>

7.5 was a while ago. Were you by chance using this?

> [@Math Extensions for Ignition](https://forum.inductiveautomation.com/t/math-extensions-for-ignition/3106):
>
> EDIT 2017-07-13: Things have changed enough that this first post is getting revamped. EDIT 2019-08-08: Re-uploaded due to broken link Some useful math functions just aren’t available through scripting. This is an attempt to rectify some of it. Functions: sum mean rectangular-to-polar conversions polar-to-rectangular conversions simple linear regressions polynomial regression greatest-common-denominator least common multiple standard deviation (population and sample) decimal to BCD decimal t…

---

<div class="post-metadata">

**Author:** ![Venkatesh](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/venkatesh/32/72855_2.png) [@Venkatesh](https://forum.inductiveautomation.com/u/Venkatesh)\
**Post date:** [February 25, 2025, 4:36am UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/4 "2025-02-25T04:36:52Z")

</div>

We're using it in the scripting. Earlier it was working. we're using it in button in a template repeater

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [February 25, 2025, 4:45am UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/5 "2025-02-25T04:45:12Z")

</div>

Code samples please. Nobody knows what you're talking about, though I suspect @JordanCClark has made a good guess.

---

<div class="post-metadata">

**Author:** ![Venkatesh](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/venkatesh/32/72855_2.png) [@Venkatesh](https://forum.inductiveautomation.com/u/Venkatesh)\
**Post date:** [February 25, 2025, 1:25pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/6 "2025-02-25T13:25:12Z")

</div>

import math  
stdDev(Bag1,Bag2,Bag3,Bag4,Bag5)

we have this script in a button.Earlier it was working now its showing stdDev is not defined. In the ignition user manual we found "system.math.standardDeviation" function .this function is working in the script console but when I put the same in the Button its not working. Note: the button is in the template and we're calling it in a template repeater. Pls help us in this.

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 25, 2025, 1:35pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/7 "2025-02-25T13:35:25Z")

</div>

Yep. That starting to look more like mine.

If that's the only one you're using out of the extensions, toss this into a project script. Do NOT call it math, as that will override the default library. Example, I have mine in `shared.math`

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/3/f/3f9a26a67d81edbc26b957992f861a0cf8cdb88f.png)

```python
def stdDev(*args):
	sumargs=float(0)
	sumsquares=float(0)
	countargs=0
	for i in args:
		sumargs += i
		countargs += 1
	mean=sumargs/countargs
	for i in args:
		sumsquares += (i-mean)**2
	meansquares=sumsquares/countargs
	stdDeviation=meansquares ** (0.5)
	return stdDeviation

```

Put the fully qualified path to the function.  
`shared.math.stdDev(Bag1,Bag2,Bag3,Bag4,Bag5)`

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [February 25, 2025, 1:47pm UTC](https://forum.inductiveautomation.com/t/standard-deviation-function-missing-in-ignition-v8-1/102619/8 "2025-02-25T13:47:12Z")

</div>

And before anyone says, 'Jordan, that could be rewritten a bit'... yes. Yes, I know. But, nearly 14 years ago, when I wrote it, I was just starting out on the scripting side of life. It works. 😛
