the_gsru_pseudo-code
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
the_gsru_pseudo-code [2012/05/14 11:15] – created andres | the_gsru_pseudo-code [2012/05/14 11:21] – andres | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | This is from [[http:// | ||
+ | |||
+ | * Fortran code: | ||
<code fortran> | <code fortran> | ||
Double precision:: xpx(neq), | Double precision:: xpx(neq), | ||
Line 23: | Line 26: | ||
enddo | enddo | ||
enddo | enddo | ||
+ | </ | ||
+ | |||
+ | * R code: | ||
+ | <code rsplus> | ||
+ | #get diagonal of X’X | ||
+ | for (i in 1:neq) { | ||
+ | xpx[i]=crossprod(X[, | ||
+ | } | ||
+ | for (iter in 1:1000) { | ||
+ | #Gauss Seidel | ||
+ | for (i in 1:neq){ | ||
+ | lhs=xpx[i]+lambda | ||
+ | rhs=crossprod(X[, | ||
+ | val=rhs/lhs | ||
+ | e = e - X[,i]*(val - ahat[i]) | ||
+ | ahat[i]=val | ||
+ | } | ||
+ | } | ||
</ | </ |
the_gsru_pseudo-code.txt · Last modified: 2024/03/25 18:22 by 127.0.0.1