Standard deviation (N-1) (SDN1#)

This calculates a standard deviation for a series between two dates or a moving standard deviation over a time period. This function has both static and moving formats. SDN1# uses N - 1, the number of values minus 1, as the divisor to calculate the degree to which individual values in a sequence vary from the mean (average) of all values in that series. The lower the standard deviation, the less individual values vary from the mean.A parameter N can be used to return N/A if there are any missing values in the data sample.The formula used in the calculation is:

Where is the mean of the values.

Formats

SDN1#(Expression,Start Date,End Date)

This calculates a single standard deviation value between the Start Date and End Date . Actual dates are typed in using either the standard DD/MM/YY format, or the displacement date formats. As a date parameter one can also use YRE, HFE, QTE, MTE, WKE, LYE, BDATE, BDATEXXF. It is also possible to use MIN and MAX here.

SDN1#(Expression)

If you do not specify start and dates, the defaults are the start and end dates for the display period.

SDN1#(Expression,Period)

This moving format calculates a continuous standard deviation (N-1) over a the time period specified between the start and end dates for the display period. Use the period codes to specify the period.

SDN1#(Expression,Period,Parameter)

The parameter set to N can be used to return N/A if there are any missing values in the data sample.

Examples

SDN1#(F:LOVU,1/1/98,31/12/98)

This static format calculates a single valuefor the standard deviation (N-1) between 1/1/98 and 31/12/98.

SDN1#(F:LOVU,20D)

This moving format calculates a continuous standard deviation (N-1) over a 20 day period between the start and end dates for the display period.

SDN1#(PCH#(AIE,1D),783D,N)

This calculates a rolling standard deviation but only shows valid values when there are about three years of daily returns in the data sample.

Warning

You must use a standard deviation period that is consistent with the frequency of the stored data. That is, the Period frequency you request for the function can be greater but not less than the data frequency. For example:

SDN1#(UKBCJD..,30D)

A daily time period is invalid for the UK unemployment series because the frequency of the data is monthly.

Note You can use SDN1# with a maximum of 4,000 values. If you request a standard deviation period which requires more than 4,000 values, an error message is displayed. To reduce the number of values, either reduce the display period or the standard deviation period. These time periods should not exceed 15 years.