[R] while loop / ICA
jankov
jankov at yandex.ru
Wed Feb 16 13:10:03 CET 2011
Hello,
after (1) getting independent components from the (200*20) data matrix X_t by applying
PearsonICA(data matrix, n.comp = 2, row.norm = FALSE, maxit = 200, tol = 1e-04, border.base = c(2.6, 4), border.slope = c(0, 1), verbose = FALSE, w.init = NULL, na.rm = FALSE, whitening.only = FALSE, PCA.only = FALSE)
I am (2) trying to let the ICA-components converge (abs($S_1-$S_0)<0) in the relation
X_t=Lambda*F+Lambda1*Y
with F as estimated factors obtained from the observed time series X_t (200*1-vector) and Y_t(2*1-vector). The goal is to obtain final estimate of F and then to estimate VAR in F and Y, FAVAR.
My version is:
#multiplicate the rows (20 time periods) of the column-ordered by variables matrix X_ with the column of the two independent components from the step (1), get the initial #estimate F_0
#print (F_0)
while (abs(F_0-F_1)<0,01) {
regression<-lm(X_t~F_0,Y_t)
#here is the place for beta_y_t, obtained regression coefficient relating to Y_t
beta_y_t<-regression$coefficients[2]
X_1_t<-X_t-beta_y_t*Y_t #new data
F_0<-PearsonICA(X_1_t, n.comp = 2, row.norm = FALSE, maxit = 200, tol = 1e-04, border.base = c(2.6, 4), border.slope = c(0, 1), verbose = FALSE, w.init = NULL, na.rm = FALSE, whitening.only = FALSE, PCA.only = FALSE)
F_1<-F_0
}
F_1
Thanks in advance
Viktor
More information about the R-help
mailing list