R/localvar.R

localvar <-
function (spec) 
{
#
# Compute time-varying local variance from a spectrum
#
J <- spec$nlevels
n <- 2^J
m <- matrix(spec$D, nrow = J, ncol = n, byrow = TRUE)
#
# Sum spectra over scale
#
answer <- apply(m, 2, sum)
return(answer)
}

Try the costat package in your browser

Any scripts or data that you put into this service are public.

costat documentation built on Sept. 8, 2023, 5:18 p.m.