R/lin_basis_func.R

lin_basis_func <- function(freq, nbeta){
  nbasis <- nbeta-1
  n <- length(freq)
  omega <- matrix(0,n,nbasis)
  for (j in 1:nbasis){
    omega[,j] <- sqrt(2)*cos(2*j*pi*freq)/(2*pi*j)
  }
  return(cbind(rep(1,n),omega))
}

Try the BayesSpec package in your browser

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

BayesSpec documentation built on May 2, 2019, 2:44 a.m.