Description Usage Arguments Details Value Warning Author(s) References See Also Examples
Computes the theoretical SDF at the Fourier frequencies for a time series of length n. Used for Whittle MLE. Assumes model parameters are valid for a stationary process.
1 2 |
n |
length of time series |
d |
ARTFIMA difference parameter, any real value. When d=numeric(0), reduces to ARMA and lambda is ignored. |
lambda |
ARTFIMA tempered decay parameter. When lambda=numeric(0), reduces to ARFIMA |
phi |
AR coefficients |
theta |
MA coefficients, Box-Jenkins definition |
obj |
object of class artfima |
plot |
type of plot, "log-log", "log" or "none" |
The Fourier frequencies, 2*pi*c(1/n, floor(n/2)/n, 1/n), are used in the definition of the SDF. The SDF is normalized so that the area over (0, 0.5) equals the variance of the time series assuming unit innovation variance. The periodogram is normalized in the same way, so the mean of the periodogram is an estimate of the variance of the time series. See example below.
vector of length floor(n/2) containing the values of the SDF at the Fourier frequencies, 2*pi*c(1/n, floor(n/2)/n, 1/n).
This function serves as a utility function for Whittle estimation so, for speed, we skip the checking if the parameters d, phi, or lambda are valid parameters for a stationary process.
A. I. McLeod, aimcleod@uwo.ca
TBA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | phi <- 0.8
n <- 256
set.seed(4337751)
z <- artsim(n, phi=phi)
VarZ <- mean((z-mean(z))^2)
Ip <- Periodogram(z)
length(Ip)
x <- (1/n)*(1:length(Ip))
plot(x, Ip, xlab="frequency", ylab="Spectral density & Periodogram",
main=paste("AR(1), phi =", phi), type="l", col=rgb(0,0,1,0.5))
n <- 5000
y <- artfimaSDF(n, phi=phi)
x <- (1/n)*(1:length(y))
lines(x, y, type="l", lwd=1.25)
h <- x[2]-x[1] #step length
SimpsonsRule <- function(h, y) {
n <- length(y)
h/3*sum(y * c(1, rep(c(4,2), n-1), 1))
}
AreaApprox <- SimpsonsRule(h, y)
text(0.2, 50, labels=paste("Area under SDF using Simpson's Rule =",
round(AreaApprox,4)))
TVarZ <- 1/(1-phi^2)
text(0.2, 40, labels=paste("Theoretical AR Variance =", round(TVarZ,4)))
text(0.2, 30, labels=paste("mean(Ip) =", round(mean(Ip),4)))
text(0.2, 20, labels=paste("sample variance =", round(VarZ,4)))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.