R/ESS.R

Defines functions ESS

Documented in ESS

ESS <-
function(trace, tol = 1e-8){
  if (NCOL(trace) > 1) stop('univariate input only')
  v = spec.ic(trace, BIC=TRUE, plot=FALSE)
  spec0 = as.numeric(v[[2]][1,2])
  if (spec0 <= tol){
    return(0) 
  } else {
    return(round(length(trace)*var(trace)/spec0, 4))
 }
}

Try the astsa package in your browser

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

astsa documentation built on Jan. 10, 2023, 1:11 a.m.