Home : Products : Hach WIMS : Hach WIMS Client : Documentation : Function Reference : Math Toolbox Functions : MOVMn
Q10865 - INFO: MOVMn
MOVMn returns an n day moving median of a specified variable. 

SYNTAX:

MOVMn(Cx)
where :
Cx is a conditional variable x
n specifies the number of days to calclulate a median from. For daily detail variables, this specifies the number of slots (i.e., hours for hourly variables).

NOTES:

n MUST be between 1 and 100.  Spans larger than 100 days will not calculate

In general, a conditional variable should be used (Cx); if a variable reference is used (Vx), a result will only be returned if every day in the calculation range contains a value.

The result will include the current date in the calculation.

This function requires the target and source variable frequencies to match. E.g. Hourly target variable = Hourly source variable, 5-Minute Target variable = 5-Minute Source Variable. If the frequencies do not match, the function will return incorrect values.

EXAMPLE 1: Return the Moving Daily Median of 14 days from a daily variable.

Source variable (71) is set to Daily and Target variable (115) is also set to Daily. Because both the Source and Target variables are the same (Daily), the time increment BYDAY will be used.

V117 = MOVM14(C71)

Each day, variable 117 will contain the median of the last 14 daily values in variable 71:

 

Example 2: Return the seven hour Moving Median from an hourly variable.

Source variable (4714) is set to Hourly and Target variable (4715) is set to Hourly.

V4714 - Is a hourly parameter
V4715 - Is a hourly calculation

V4715 = MOVM7(V4714)

Our results will be as follows:

See: Working with Daily Detail Variables in Calculations.

Example with MDL Rules:

V = MOVM3(V5261) and V = MOVM4(V5261)

On calculated variables, it is possible to elect to cascade MDL rules or not. Below is an example of cascading MOST frequent MDL symbol, ALL MDL symbols, and NONE or no MDL symbols. This also shows the difference between even number of data points and an odd number of data points when choosing a median value.

V9621 and V9631 - Most Frequent MDL Symbol
V9922 and V9632 - All MDL Symbols
V9623 and V9633 - No MDL Symbols

V9621, V9622, and V9623 have odd number of data points
V9631, V9632, and V9633 have even number of data points

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?

poor 
1
2
3
4
5
6
7
8
9
10

 excellent
Tell us why you rated the content this way. (optional)
 
Approved Comments...
No user comments available for this article.
Created on 4/3/2008 10:27 AM.
Last Modified on 2/11/2015 11:56 AM.
Last Modified by No Author Name Available!.
Article has been viewed 4489 times.
Rated 7 out of 10 based on 6 votes.
Print Article
Email Article