Displaying 1 result from an estimated 1 matches for "gov1".
Did you mean:
gov
2010 Nov 03
1
Orthogonalization with different inner products
...ov(X_i,Z_1)Z_1/var(Z_1)-...- cov(X_i,Z__{i-1})Z__{i-1}/var(Z_{i-1}) I have code to do this but I keep getting a "non-conformable array" error in the line with the covariance. Does anyone have any suggestions? Here is my code:
gov=read.table(file.choose(), sep="\t",header=T)
gov1=gov[3:length(gov[1,])]
n_indices=length(names(gov1))
x=data.matrix(gov1)
v=x
R=matrix(rep(0,length(x[,1])*length(x[1,])),length(x[,1]))
for(j in 1:n_indices){
u=matrix(rep(0,length(v[,1])),length(v[,1]))
for(i in 1:j-1){
u = u+cov(v[,j],v[,i])*v[,i]/var(v[,i]) #(error here...