R/Students-t-test.R

Student <- function(res,Data,Ct,s2,v,lag,B1)
{

if (ncol(res)>1) {p <- ncol(Data)}
if (ncol(res)==1) {p <- 1}

ad <- matrix(nrow=p,ncol=2)
for(k in 1:p)
{
u.hat <- res[,k]/sqrt(((v/(v+ncol(B1)-2))*(s2[k,k]))*Ct) 
AD <- ad.test(u.hat,pt,df=v+ncol(B1))
ad[k,] <- cbind(AD[1]$statistic, AD[2]$p.value)
}
colnames(ad) <- c("AD","p-value")

return(list(ad=ad))

}

Try the StVAR package in your browser

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

StVAR documentation built on May 1, 2019, 8:22 p.m.