[R-SIG-Finance] rollapply + lowess indicator

me at censix.com me at censix.com
Sun Apr 24 18:00:11 CEST 2011


> Playing around a little with the lowess smoother. I tried the following
> and
> it doesn't seem to work. What am I doing wrong ?
>
> require(quantmod)
> getSymbols("^GSPC", src="yahoo", from="2000-01-01", to=Sys.Date())
> GSPC <-na.omit(Ad(GSPC))
> ind <- rollapply(GSPC, 200, lowess , align="right")
> print(head(ind))
>
> I get the following output :
>
>            GSPC.Adjusted
> 2000-10-16 List,2
> 2000-10-17 List,2
> 2000-10-18 List,2
> 2000-10-19 List,2
> 2000-10-20 List,2
> 2000-10-23 List,2
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions
> should go.
>

Maybe you want to do this ?

ind <- rollapply(GSPC, 200, function(z) {lowess(z)$y} , align="right")


-- 
http://censix.com



More information about the R-SIG-Finance mailing list