I am having trouble plotting outliers on time series.

Give then following code:
############################################################
# find STL Outliers by weight and append sh2, use Robust
# this should allow the initial outliers to be filtered
# this section may be commented out.
############################################################
tsSourceDiag <- stl(tsSource,s.window="per", robust=TRUE)
#
tsSourceIO <- which(tsSourceDiag $ weights  < 1e-8)
#
# This is how to append run-time regessors
for(z in tsSourceIO) {
tmpname <-paste("PreIO",z,sep="")
#COPY EOM REGRESSOR AS A TEMPLATE
sh2[[tmpname]] <- sh2[["EOM"]]
#SET IT ALL TO 0
sh2[[tmpname]][]<-FALSE
#SET The Proper Indice to TRUE
sh2[[tmpname]][z]<- TRUE
}
Ok so I have a time series tsSource. I yank out the index of each
tsSourceDiag and appending it to an existing list of regressors with all
false save one that is true for the index of the suspected outlier.

I decided that a plot of the time series as points was in order and thought,
"Hey I should really fill the circle that is considered an outlier red so I
can eye ball check the graph to see if that is indeed an outlier needing
agent Fox and Scully to investigate (yes my later list of outliers is in
fact called "XFILES").

So I am like, BOOM! plot(tsSource) and points(tsSource[tsSourceIO]). Nada.

A plot of tsSource[tsSourceIO] reveals a hint of what is wrong. tsSource is
as time series with date info while tsSource[tsSourceIO] is just a series
with no proper alignment with the cosmic universe... errr... I mean time
series.

Anyone have some sweet voodoo on how to get a proper time series plot while
properly overplotting various indicies? (e.g. tsSeries[c=(1,22,11,61)])

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to