kernel(stats)
kernel()所属R语言包:stats
Smoothing Kernel Objects
平滑内核对象
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The "tskernel" class is designed to represent discrete symmetric normalized smoothing kernels. These kernels can be used to smooth vectors, matrices, or time series objects.
"tskernel"类被设计为代表的离散对称归平滑内核。这些内核可用于光滑的向量,矩阵,或时间序列对象。
There are print, plot and [ methods for these kernel objects.
有print,plot和[这些内核对象的方法。
用法----------Usage----------
kernel(coef, m = 2, r, name)
df.kernel(k)
bandwidth.kernel(k)
is.tskernel(k)
## S3 method for class 'tskernel'
plot(x, type = "h", xlab = "k", ylab = "W[k]",
main = attr(x,"name"), ...)
参数----------Arguments----------
参数:coef
the upper half of the smoothing kernel coefficients (including coefficient zero) or the name of a kernel (currently "daniell", "dirichlet", "fejer" or "modified.daniell".
目前的上半部分平滑内核系数(系数为零)的内核名称("daniell","dirichlet","fejer"或"modified.daniell"。
参数:m
the kernel dimension(s) if coef is a name. When m has length larger than one, it means the convolution of kernels of dimension m[j], for j in 1:length(m). Currently this is supported only for the named "*daniell" kernels.
如果coef是出了名的内核尺寸(S)。当m长度大于1,这意味着卷积内核维m[j],j in 1:length(m)。目前,这一被命名为“丹尼尔”内核仅支持。
参数:name
the name the kernel will be called.
名称的内核将被调用。
参数:r
the kernel order for a Fejer kernel.
的Fejer内核为内核的秩序。
参数:k, x
a "tskernel" object.
"tskernel"对象。
参数:type, xlab, ylab, main, ...
arguments passed to plot.default.
参数传递到plot.default。
Details
详情----------Details----------
kernel is used to construct a general kernel or named specific kernels. The modified Daniell kernel halves the end coefficients (as used by S-PLUS).
kernel被用来构建一个通用的内核或命名的特定内核。修改后的的丹尼尔内核减半结束系数(,S-PLUS)。
The [ method allows natural indexing of kernel objects with indices in (-m) : m. The normalization is such that for k <- kernel(*), sum(k[ -k$m : k$m ]) is one.
[方法允许在(-m) : m指数内核对象的自然索引。 k <- kernel(*),sum(k[ -k$m : k$m ])是一个正常化等。
df.kernel returns the "equivalent degrees of freedom" of a smoothing kernel as defined in Brockwell and Davis (1991), page 362, and bandwidth.kernel returns the equivalent bandwidth as defined in Bloomfield (1976), p. 201, with a continuity correction.
df.kernel返回一个平滑的内核在Brockwell和戴维斯(1991),页362定义“同等程度的自由”,bandwidth.kernel返回的等效带宽菲尔德(1976),定义。 201,连续性校正。
值----------Value----------
kernel() returns an object of class "tskernel" which is basically a list with the two components coef and the kernel dimension m. An additional attribute is "name".
kernel()返回一个对象,这基本上是一个列表中的两个组成部分"tskernel"和内核的尺寸coef类m。一个额外的属性是"name"。
作者(S)----------Author(s)----------
A. Trapletti; modifications by B.D. Ripley
参考文献----------References----------
Fourier Analysis of Time Series: An Introduction. Wiley.
Time Series: Theory and Methods. Second edition. Springer, pp. 350–365.
参见----------See Also----------
kernapply
kernapply
举例----------Examples----------
require(graphics)
## Demonstrate a simple trading strategy for the[#展示一个简单的交易策略。]
## financial time series German stock index DAX.[#金融时间序列的德国股票指数DAX指数。]
x <- EuStockMarkets[,1]
k1 <- kernel("daniell", 50) # a long moving average[长期移动平均线]
k2 <- kernel("daniell", 10) # and a short one[和短]
plot(k1)
plot(k2)
x1 <- kernapply(x, k1)
x2 <- kernapply(x, k2)
plot(x)
lines(x1, col = "red") # go long if the short crosses the long upwards[如果短期横渡长向上走多久]
lines(x2, col = "green") # and go short otherwise[去短,否则]
## More interesting kernels[#更有趣的内核]
kd <- kernel("daniell", c(3,3))
kd # note the unusual indexing[注意不寻常的索引]
kd[-2:2]
plot(kernel("fejer", 100, r=6))
plot(kernel("modified.daniell", c(7,5,3)))
# Reproduce example 10.4.3 from Brockwell and Davis (1991)[重现从Brockwell和戴维斯(1991)的例子10.4.3]
spectrum(sunspot.year, kernel=kernel("daniell", c(11,7,3)), log="no")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|