
#Function to determine the periodogram of a set of data.
#Written by Bob Sherman, Walter Willinger

 per <- function (z)
          {n<-length(z)
          (Mod(fft(z))^2/(2*pi*n)) [1:(n %/% 2 + 1)]}

#Function to determine the periodogram of a set of data for stable process.

#Writen by Vadim Teverovsky
 perstable <- function (z)
          {n<-length(z)
	   norm_sum((z^2)[1:n])
          (Mod(fft(z))^2/(2*pi*n*norm)) [1:(n %/% 2 + 1)]}





