Skip to content

Problem using stl() on data from quantmod

2 messages · Brian G. Peterson, Jeff Ryan

#
Ok, I see no reason at all for using as.ts here.  Leave your data in xts.
Wind <windspeedo at qq.com> wrote:

            
#
The issue is in stl which will convert (try) to ts internally:
function (x, s.window, s.degree = 0, t.window = NULL, t.degree = 1,
...
    x <- na.action(as.ts(x))
    if (is.matrix(x))
        stop("only univariate series are allowed")
    n <- length(x)
    period <- frequency(x)
    if (period < 2 || n <= 2 * period)
        stop("series is not periodic or has less than two periods")

Which will result in an object of freq=1, and thus throw an error.

Jeff
On Mon, Dec 29, 2008 at 9:49 AM, Brian G. Peterson <brian at braverock.com> wrote: