powered by
Auxiliary function to form matrices equal to x everywhere except from the upper/lower k diagonal, which values are vec
myDiag(x, vec, k)
initial matriw
vector with specified new values for the upper/lower k diagonal elements of x
index of the diagonal
x
# NOT RUN { K=3 u <- sqrt(1/(4-1/seq(1,(K-1))^2)) n = length(u)+1 trans = myDiag(matrix(0,n, n),u,1) + myDiag(matrix(0,n, n),u,-1) # }
Run the code above in your browser using DataLab