spec.pgram(stats)
spec.pgram()所属R语言包:stats
Estimate Spectral Density of a Time Series by a Smoothed
由平滑时间序列的谱密度估计
译者:生物统计家园网 机器人LoveR
描述----------Description----------
spec.pgram calculates the periodogram using a fast Fourier transform, and optionally smooths the result with a series of modified Daniell smoothers (moving averages giving half weight to the end values).
spec.pgram用快速傅里叶变换计算周期图,可选平滑的一系列改性丹尼尔平滑(均线一半重量的最终值)的结果。
用法----------Usage----------
spec.pgram(x, spans = NULL, kernel, taper = 0.1,
pad = 0, fast = TRUE, demean = FALSE, detrend = TRUE,
plot = TRUE, na.action = na.fail, ...)
参数----------Arguments----------
参数:x
univariate or multivariate time series.
单因素或多元时间序列。
参数:spans
vector of odd integers giving the widths of modified Daniell smoothers to be used to smooth the periodogram.
矢量平滑给改性丹尼尔的宽度奇数的被用来平滑周期图。
参数:kernel
alternatively, a kernel smoother of class "tskernel".
另外,一个内核级的"tskernel"平滑。
参数:taper
specifies the proportion of data to taper. A split cosine bell taper is applied to this proportion of the data at the beginning and end of the series.
指定锥度数据的比例。分割余弦钟锥应用于这个比例的数据系列的开头和结尾。
参数:pad
proportion of data to pad. Zeros are added to the end of the series to increase its length by the proportion pad.
垫的数据比例。零点添加到年底的系列,以增加它的长度比例pad。
参数:fast
logical; if TRUE, pad the series to a highly composite length.
逻辑;如果TRUE,垫一个高度综合的长度系列。
参数:demean
logical. If TRUE, subtract the mean of the series.
逻辑。如果TRUE,减去该系列的平均值。
参数:detrend
logical. If TRUE, remove a linear trend from the series. This will also remove the mean.
逻辑。如果TRUE,删除从一系列的线性趋势。这也将删除的意味。
参数:plot
plot the periodogram?
绘制的周期图?
参数:na.action
NA action function.
NA动作功能。
参数:...
graphical arguments passed to plot.spec.
图形参数传递到plot.spec。
Details
详情----------Details----------
The raw periodogram is not a consistent estimator of the spectral density, but adjacent values are asymptotically independent. Hence a consistent estimator can be derived by smoothing the raw periodogram, assuming that the spectral density is smooth.
原始周期图是一致的谱密度估计,但相邻的值是渐近独立的。平滑原材料周期图,假设谱密度是顺利的,因此可以得出一个一致的估计。
The series will be automatically padded with zeros until the series length is a highly composite number in order to help the Fast Fourier Transform. This is controlled by the fast and not the pad argument.
该系列将自动用零填充,直到序列的长度是一个高度综合的数字,以帮助快速傅立叶变换。这是控制由fast不pad论点。
The periodogram at zero is in theory zero as the mean of the series is removed (but this may be affected by tapering): it is replaced by an interpolation of adjacent values during smoothing, and no value is returned for that frequency.
在零周期图是在理论上为零作为该系列的平均被删除(但是这可能是由尖细的影响):它被替换在平滑插值相邻值,没有值返回该频率。
值----------Value----------
A list object of class "spec" (see spectrum) with the following additional components:
一个列表对象类"spec"(见spectrum)以下的附加组件:
参数:kernel
The kernel argument, or the kernel constructed from spans.
kernel论点,或从spans构建内核。
参数:df
The distribution of the spectral density estimate can be approximated by a (scaled) chi square distribution with df degrees of freedom.
(规模)智df自由度平方分布谱密度估计的分布可以近似。
参数:bandwidth
The equivalent bandwidth of the kernel smoother as defined by Bloomfield (1976, page 201).
等效带宽的内核由菲尔德定义平滑(1976年,第201页)。
参数:taper
The value of the taper argument.
taper参数值。
参数:pad
The value of the pad argument.
pad参数值。
参数:detrend
The value of the detrend argument.
detrend参数值。
参数:demean
The value of the demean argument.
demean参数值。
The result is returned invisibly if plot is true.
返回结果如果plot是真正的无形。
作者(S)----------Author(s)----------
Originally Martyn Plummer; kernel smoothing by Adrian Trapletti,
synthesis by B.D. Ripley
参考文献----------References----------
Introduction. Wiley.
Methods. Second edition. Springer.
Statistics with S. Fourth edition. Springer. (Especially pp. 392–7.)
参见----------See Also----------
spectrum, spec.taper,
spectrum,spec.taper
举例----------Examples----------
require(graphics)
## Examples from Venables & Ripley[#例如从维纳布尔斯和里普利]
spectrum(ldeaths)
spectrum(ldeaths, spans = c(3,5))
spectrum(ldeaths, spans = c(5,7))
spectrum(mdeaths, spans = c(3,3))
spectrum(fdeaths, spans = c(3,3))
## bivariate example[#二元的例子]
mfdeaths.spc <- spec.pgram(ts.union(mdeaths, fdeaths), spans = c(3,3))
# plots marginal spectra: now plot coherency and phase[图边际谱:现在小区的一致性和相位]
plot(mfdeaths.spc, plot.type = "coherency")
plot(mfdeaths.spc, plot.type = "phase")
## now impose a lack of alignment[#现在并处对齐的缺乏]
mfdeaths.spc <- spec.pgram(ts.intersect(mdeaths, lag(fdeaths, 4)),
spans = c(3,3), plot = FALSE)
plot(mfdeaths.spc, plot.type = "coherency")
plot(mfdeaths.spc, plot.type = "phase")
stocks.spc <- spectrum(EuStockMarkets, kernel("daniell", c(30,50)),
plot = FALSE)
plot(stocks.spc, plot.type = "marginal") # the default type[默认类型]
plot(stocks.spc, plot.type = "coherency")
plot(stocks.spc, plot.type = "phase")
sales.spc <- spectrum(ts.union(BJsales, BJsales.lead),
kernel("modified.daniell", c(5,7)))
plot(sales.spc, plot.type = "coherency")
plot(sales.spc, plot.type = "phase")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|