Skip to content
Back to formatted view

Raw Message

Message-ID: <tencent_445647FB0D42DFC339CD4AF6@qq.com>
Date: 2008-12-29T13:45:53Z
From: Wind
Subject: Problem using stl() on data from quantmod

With the following code, 

getSymbols("^GSPC")
xx<-as.ts(GSPC[,4])
xx<-na.approx(xx)
plot(stl(log(xx),s.window="period"))

There is an error:
Error in stl(log(xx), s.window = "period") : 
  only univariate series are allowed

> str(log(xx))
 ts [1:724, 1] 7.26 7.26 7.25 7.25 7.25 ...
 - attr(*, "dimnames")=List of 2
  ..$ : NULL
  ..$ : chr "GSPC.Close"
 - attr(*, "tsp")= num [1:3] 13516 14239     1

It seems that the structure of xx is a little complicated.   But I still don't know how to trim it to the simplest ts format.

Regards,
Wind