the_gsru_pseudo-code
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
the_gsru_pseudo-code [2012/05/14 11:16] – andres | the_gsru_pseudo-code [2024/03/25 18:22] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
This is from [[http:// | This is from [[http:// | ||
+ | * Fortran code: | ||
<code fortran> | <code fortran> | ||
Double precision:: xpx(neq), | Double precision:: xpx(neq), | ||
Line 25: | 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.1336994215.txt.gz · Last modified: 2024/03/25 18:22 (external edit)