R/speclagreg.K.threshold.R

speclagreg.K.threshold = function(X,Y,freq){  
  K = freq
  n = dim(X)[1]
  th = 1/sqrt(n)
  
  SXX = spectral.density(X,freq=freq)
  for (i in 1:length(K)){
    E = eigen(SXX$operators[,,i])
    K[i] = max(1,sum(abs(E$values) > th))
  }
  
  return(K)    
}  
kidzik/freqdom.lin documentation built on May 11, 2019, 4:17 p.m.