R/deplie2.VM.R

Defines functions deplie2.VM

deplie2.VM <-
function(Y,M=NULL) { 

  if (is.null(M)) {M = floor((-1+sqrt(1+4*length(Y)))/2)}
  trans = matrix(0,M,M-1);
  nc = ((length(Y)-(M*(M-1)))/M)/2
  tmp = M*(M-1)
  par.trans = matrix(0,M,nc);
  for (i in 1:(M-1)){
     trans[,i] = Re(Y[(M*(i-1)+1):(M*i)]);
     }
  for (i in 1:nc) {
  #	par.trans[,i] = Y[(M*(M-1)+(i-1)*nc+1 ):(M*(M-1)+i*nc )]
  	par.trans[,i] = Y[(M*(M-1)+(i-1)*M+1 ):(M*(M-1)+i*M )]+1i*Y[(M*(M-1)+nc*M+(i-1)*M+1 ):(M*(M-1)+nc*M+i*M )]
  }
  res <- NULL
  res$trans <- trans
  res$par <- par.trans
  return(res)

}

Try the NHMSAR package in your browser

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

NHMSAR documentation built on Feb. 9, 2022, 9:06 a.m.