R/privateFunctions.r

Defines functions sStationary trace L s.int

.is.int <- function (x, tolerance = .Machine$double.eps){
    abs(x - round(x)) < tolerance
}


.LL <- function (S, P){
    LL <- -log(det(P)) + .trace(S %*% P)
    return(LL)
}

.trace <- function (M) {
    return(sum(diag(M)))
}

.isStationary <- function(A){
	#############################################################################
	# tests whether the VAR(1) process associated with matrix A is stationary
	#############################################################################
	
	# assess stationarity	
    	evs <- abs(eigen(A, only.values=TRUE)$values)
    	if (max(evs) > 1){ print("WARNING: the VAR(1) process associated with the supplied matrix A is not stable!") }
}

Try the ragt2ridges package in your browser

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

ragt2ridges documentation built on Nov. 21, 2017, 5:06 p.m.