Skip to content

Spectrum confidence interval

2 messages · Clément Poirier, Uwe Ligges

#
Dear useRs,

I'd like to plot a confidence interval on a periodogram. My problem is 
that spec.pgram(sunspots,ci=0.95,log="yes") gives me a blue error bar on 
the plot, but spec.pgram(sunspots,ci=0.95,log="no") does not. My 
questions are:
1. how should I plot the confidence interval with log="no"?
2. how should I get the min and max values of the confidence interval?
Many thanks for your help!
Clement Poirier
11 days later
#
Late answer, but maybe still helpful (if I am correct this question is 
still unanswered on R-help):
Cl?ment Poirier wrote:
This is not supported in plot.spec (the plot method for spec objects), 
since handled in the else part after
   if (ci <= 0 || !is.numeric(x$df) || log == "no")
Type
  plot.spec

In the code for that function, you will find the function definition of 
spec.ci() which calculates the confidence intervals. Just define that 
function in your workspace and you can go on and add lines to your plot now.

Best wishes,
Uwe Ligges