Main Content


Smooth data

smoothts is not recommended. Use smoothdata instead.


output = smoothts(input)
output = smoothts(input,'b',wsize)
output = smoothts(input,'g',wsize,stdev)
output = smoothts(input,'e',n)



Financial time series object or a row-oriented matrix. In a row-oriented matrix, each row represents an individual set of observations.

'b', 'g', or 'e'

Smoothing method (essentially the type of filter used). Can be Exponential (e), Gaussian (g), or Box (b). Default = b.


Window size (scalar). Default = 5.


Scalar that represents the standard deviation of the Gaussian window. Default = 0.65.


For Exponential method, specifies window size or exponential factor, depending upon value.

  • n > 1 (window size) or period length

  • n < 1 and > 0 (exponential factor: alpha)

  • n = 1 (either window size or alpha)

If n is not supplied, the defaults are wsize = 5 and alpha = 0.3333.


smoothts smooths the input data using the specified method.

output = smoothts(input) smooths the input data using the default Box method with window size, wsize, of 5.

output = smoothts(input,'b',wsize) smooths the input data using the Box (simple, linear) method. wsize specifies the width of the box to be used.

output = smoothts(input,'g',wsize,stdev) smooths the input data using the Gaussian window method.

output = smoothts(input,'e',n) smooths the input data using the Exponential method. n can represent the window size (period length) or alpha. If n > 1, n represents the window size. If 0 < n < 1, n represents alpha, where


If input is a financial time series object, output is a financial time series object identical to input except for contents. If input is a row-oriented matrix, output is a row-oriented matrix of the same length.

Introduced before R2006a