[R] Hankel Matrix

Erich Neuwirth erich.neuwirth at univie.ac.at
Fri Apr 30 12:04:09 CEST 2004


hankel<-function(seq){
outer(1:((length(seq)+1)/2),1:((length(seq)+1)/2),
     function(x,y) seq[x+y-1])
}


will take a sequence of odd length and ouput the corresponding
square Hankel matrix.


Fred J. wrote:

 > Hello
 > is there a function in R to generate Hankel Matrix?



-- 
Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386




More information about the R-help mailing list