> library(ts)# # The following works as I expected, #> kernel("daniell",m=5)Daniell(5) coef[-5] = 0.09091 coef[-4] = 0.09091 coef[-3] = 0.09091 coef[-2] = 0.09091 coef[-1] = 0.09091 coef[ 0] = 0.09091 coef[ 1] = 0.09091 coef[ 2] = 0.09091 coef[ 3] = 0.09091 coef[ 4] = 0.09091 coef[ 5] = 0.09091 # # but the following does not. The doc says end points have # weights halved. #> kernel("modified.daniell",m=5)mDaniell(5) coef[-5] = 0.10 coef[-4] = 0.10 coef[-3] = 0.10 coef[-2] = 0.10 coef[-1] = 0.10 coef[ 0] = 0.05 coef[ 1] = 0.10 coef[ 2] = 0.10 coef[ 3] = 0.10 coef[ 4] = 0.10 coef[ 5] = 0.10 # # I do not know whether this is legal. Looking at the source I # got the impression m can be a vector, and the Daniell kernel is # applied in cascade. The resulting kernel seems to confirm this # (because of its length) but the weights do not seem right. They # are not even symmetrical; #> kernel("daniell",m=c(3,5,7))unknown coef[-15] = 0.0649351 coef[-14] = 0.0640693 coef[-13] = 0.0614719 coef[-12] = 0.0580087 coef[-11] = 0.0536797 coef[-10] = 0.0484848 coef[ -9] = 0.0424242 coef[ -8] = 0.0363636 coef[ -7] = 0.0303030 coef[ -6] = 0.0242424 coef[ -5] = 0.0181818 coef[ -4] = 0.0129870 coef[ -3] = 0.0086580 coef[ -2] = 0.0051948 coef[ -1] = 0.0025974 coef[ 0] = 0.0008658 coef[ 1] = 0.0649351 coef[ 2] = 0.0640693 coef[ 3] = 0.0614719 coef[ 4] = 0.0580087 coef[ 5] = 0.0536797 coef[ 6] = 0.0484848 coef[ 7] = 0.0424242 coef[ 8] = 0.0363636 coef[ 9] = 0.0303030 coef[ 10] = 0.0242424 coef[ 11] = 0.0181818 coef[ 12] = 0.0129870 coef[ 13] = 0.0086580 coef[ 14] = 0.0051948 coef[ 15] = 0.0025974 # # Can someone clarify me on this? #> R.Version()$platform [1] "i686-pc-linux-gnu" $arch [1] "i686" $os [1] "linux-gnu" $system [1] "i686, linux-gnu" $status [1] "" $major [1] "1" $minor [1] "2.2" $year [1] "2001" $month [1] "02" $day [1] "26" $language [1] "R"> proc.time()[1] 0.62 0.17 0.78 0.00 0.00>-- Fernando TUSELL e-mail: Departamento de Econometr?a y Estad?stica etptupaf at bs.ehu.es Facultad de CC.EE. y Empresariales Tel: (+34)94.601.3733 Avenida Lendakari Aguirre, 83 Fax: (+34)94.601.3754 E-48015 BILBAO (Spain) Secr: (+34)94.601.3740 PGP: finger etptupaf at bsdx01.bs.ehu.es http://etdx01.bs.ehu.es ---------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> library(ts)# # The following works as I expected, #> kernel("daniell",m=5)Daniell(5) coef[-5] = 0.09091 coef[-4] = 0.09091 coef[-3] = 0.09091 coef[-2] = 0.09091 coef[-1] = 0.09091 coef[ 0] = 0.09091 coef[ 1] = 0.09091 coef[ 2] = 0.09091 coef[ 3] = 0.09091 coef[ 4] = 0.09091 coef[ 5] = 0.09091 # # but the following does not. The doc says end points have # weights halved. #> kernel("modified.daniell",m=5)mDaniell(5) coef[-5] = 0.10 coef[-4] = 0.10 coef[-3] = 0.10 coef[-2] = 0.10 coef[-1] = 0.10 coef[ 0] = 0.05 coef[ 1] = 0.10 coef[ 2] = 0.10 coef[ 3] = 0.10 coef[ 4] = 0.10 coef[ 5] = 0.10 # # I do not know whether this is legal. Looking at the source I # got the impression m can be a vector, and the Daniell kernel is # applied in cascade. The resulting kernel seems to confirm this # (because of its length) but the weights do not seem right. They # are not even symmetrical; #> kernel("daniell",m=c(3,5,7))unknown coef[-15] = 0.0649351 coef[-14] = 0.0640693 coef[-13] = 0.0614719 coef[-12] = 0.0580087 coef[-11] = 0.0536797 coef[-10] = 0.0484848 coef[ -9] = 0.0424242 coef[ -8] = 0.0363636 coef[ -7] = 0.0303030 coef[ -6] = 0.0242424 coef[ -5] = 0.0181818 coef[ -4] = 0.0129870 coef[ -3] = 0.0086580 coef[ -2] = 0.0051948 coef[ -1] = 0.0025974 coef[ 0] = 0.0008658 coef[ 1] = 0.0649351 coef[ 2] = 0.0640693 coef[ 3] = 0.0614719 coef[ 4] = 0.0580087 coef[ 5] = 0.0536797 coef[ 6] = 0.0484848 coef[ 7] = 0.0424242 coef[ 8] = 0.0363636 coef[ 9] = 0.0303030 coef[ 10] = 0.0242424 coef[ 11] = 0.0181818 coef[ 12] = 0.0129870 coef[ 13] = 0.0086580 coef[ 14] = 0.0051948 coef[ 15] = 0.0025974 # # Can someone clarify me on this? # This is an error in print.tskernel. The internal representation of the kernel seems to be ok. The following print.tskernel does the right job: print.tskernel<-function(k, digits = max(3, getOption("digits") - 3)) { y <- c(rev(k$coef[2:(k$m + 1)]), k$coef) i <- -k$m:k$m cat(attr(k, "name"), "\n") cat(paste("coef[", format(i), "] = ", format(y, digits = digits), sep ""), sep = "\n") } You could use this print function until the bug is corrected in the R source. Adrian PS: Brian: I did not fill out a bug report. -- Dr. Adrian Trapletti, Olsen & Associates Ltd. Seefeldstrasse 233, CH-8008 Z?rich, Switzerland Phone: +41 (1) 386 48 47 Fax: +41 (1) 422 22 82 E-mail: adrian at olsen.ch WWW: http://www.olsen.ch -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thank you very much, and sorry for the delay in answering: I have been out of town for a while. ft. -- Fernando TUSELL e-mail: Departamento de Econometr?a y Estad?stica etptupaf at bs.ehu.es Facultad de CC.EE. y Empresariales Tel: (+34)94.601.3733 Avenida Lendakari Aguirre, 83 Fax: (+34)94.601.3754 E-48015 BILBAO (Spain) Secr: (+34)94.601.3740 PGP: finger etptupaf at bsdx01.bs.ehu.es http://etdx01.bs.ehu.es ---------------------------------------------------------------------- -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._