Description Usage Arguments Details Value See Also Examples
kz.smpg
is designed to smooth and plot 1D KZ periodogram easily.
It will calculate the raw periodogram, mark the spikes,
smooth the periodogram, and then output the plot.
1 
x 
The data vector for analyses. Missing values are allowed. 
dpct 
A prespecified percentage of total variation. Defaults to 1%. 
rg 
The frequency range of the outputted periodogram. Default is 0 to 0.5. 
log 
TRUE or FLASE. Use log scale for output periodogram. Defaults to FLASE. 
plot 
TRUE or FLASE. Flag for output periodogram plot or not. Defaults to FLASE. 
... 
Other arguments.

The smoothing process is based on a modified DiRienzoZurbenko (DZ) method, for which the smoothing window is not symmetric around the value point. The smoothing algorithm is implemented in C.
Data frame for outputted periodogram, including column spg for the periodogram values, and freq for the frequencies.
1 2 3 4 5 6 7 8 9 10 11 12  ## Adapted from kzft::kzp example 2
t < 1:2000
y < 1.1*sin(2*pi*0.0339*t)+7*sin(2*pi*0.0366*t)+5*rnorm(length(t),0,1)
y[sample(t,100,replace=FALSE)] < NA
## Not run:
# system.time(op < kz.smpg(y, dpct=0.0001, rg=c(0.025,0.05),
# plot=TRUE, log=TRUE, lvl="min", n=10, k=2))
## End(Not run)
op < kz.smpg(y, dpct=0.0000, f=c(0.0339,0.0366), rg=c(0.025,0.05),
n=10, k=2, plot=TRUE, lvl="min", log=FALSE)

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.