[R] kernel in library ts

F. Tusell etptupaf at bs.ehu.es
Wed Mar 7 18:49:51 CET 2001


> 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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list