https://github.com/cran/ltsa
Revision 0a03bbb7cf19e479dc77592ed09621eeb8afb470 authored by A.I. McLeod on 21 December 2015, 08:55:04 UTC, committed by cran-robot on 21 December 2015, 08:55:04 UTC
1 parent 83deceb
Tip revision: 0a03bbb7cf19e479dc77592ed09621eeb8afb470 authored by A.I. McLeod on 21 December 2015, 08:55:04 UTC
version 1.4.6
version 1.4.6
Tip revision: 0a03bbb
innovationVariance.R
innovationVariance <- function(z, method=c("AR", "Kolmogoroff"), ...){
wm <- match.arg(method, c("AR", "Kolmogoroff"))
if (length(z)<10)
stop("Series length should be at least 10!")
if (wm=="AR"){
sigmaSq <- ar(z, aic=TRUE, method="burg")$var.pred
} else {
plotQ <- ifelse(length(grep("plot", c(substitute(do.call(...)))))>0, TRUE
, FALSE)
if(plotQ) {
sdf <- spec.pgram(z, ...)$spec
} else {
sdf <- spec.pgram(z, plot=FALSE, ...)$spec
}
sigmaSq <- exp(2*sum(log(2*pi*sdf))/length(z))/(2*pi)
}
sigmaSq
}
Computing file changes ...