Re: [R] help! - spectral analysis - spec.pgram

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Thu, 27 Mar 2008 15:58:54 +0000 (GMT)

On Thu, 27 Mar 2008, Nuno Prista wrote:

> Can someone explain me this spec.pgram effect?
>
>
>
> Code:
>
>
>
> period.6<-c(0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10
> ,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10,0,0,0,0,0,10)
>
> period.5<-c(0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,0,0,10
> ,0,0,0,0,10,0,0,0,0,0,0,10,0,0,0,0,10,0,0,0,0,0,0,10,0,0,0,0,10,0)
>
>
>
> par(mfrow=c(2,1))
>
>
>
> spec.pgram(period.6, log="no")
>
> spec.pgram(period.5, log="no")
>
>
>
>
>
> The first series has period 6 and shows its periodicity in 1/6 and
> harmonics. In the second series I was expecting to see a signal occurring at
> frequency 1/5 but it does not. Can anybody explain me why?

Because it does not have period 5 but 12 ....

With such short series tapering has some effect. Try

x <- rep(c(0,0,0,0,0,10,0,0,0,0,10,0), 100) spec.pgram(x, log="no")

>
>
>
> Thanks in advance,
>
>
>
> Nuno
>
>
>
> ______________________________________________
>
> Centro de Oceanografia - IO-FCUL, Portugal
>
> Center for Quantitative Fisheries Ecology - ODU, USA
>
> email: nmprista*@fc.ul.pt ; nprista*@odu.edu
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help_at_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.
>

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_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.
Received on Thu 27 Mar 2008 - 20:03:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 27 Mar 2008 - 20:30:24 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive