periodic.series: Computation of a (deterministic) periodic time series of...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/periodic_series.R

Description

It computes and returns a sinusoid of a specified length, which has the given initial phase, and linearly changing periods (if requested) starting from a given period length through the given length at the end. There is an option to plot the time series.

Usage

1
2
3
4
  periodic.series(start.period = 100, end.period = start.period, 
                  phase = 0, 
                  length = 600, 
                  make.plot = FALSE)

Arguments

start.period

period length at start (in steps of time). Default: 100.

end.period

period length at end (in steps of time). Default: 100.

phase

phase difference (in steps of time), i.e. part of period length which has elapsed relative to the origin. Default: 0.

length

number of time steps. Default: 600.

make.plot

Plot time series? Logical. Default: FALSE.

Details

This function can be used for illustrating methods and functions.

Producing a sinusoid, periodic.series will work best if start.period (and end.period, if different from start.period) is not too small.

Value

the series as vector

Author(s)

Angi Roesch and Harald Schmidbauer

See Also

analyze.wavelet, wt.image, wt.avg, wt.sel.phases, wt.phase.image, reconstruct

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# The following time series involves periods from 100 through 50:
x <- periodic.series(start.period = 100, end.period = 50, make.plot = TRUE)
title("time series with period changing linearly from 100 to 50")

# The following three time series involve three different types of period evolution 
# starting from period 100:
x1 <- 0.8*periodic.series(start.period = 100, end.period = 95, phase = 0, length = 1000)
x2 <-     periodic.series(start.period = 100, end.period = 100, phase = 0, length = 1000)
x3 <- 1.2*periodic.series(start.period = 100, end.period = 105, phase = 0, length = 1000)

ts.plot(x2, ylim = c(-2, +2), xlab = "time", ylab = "series with variable period")
lines(x1, col = "blue")
lines(x3, col = "red")
legend("topleft", 
   legend = c("speeding up (end period = 95)", "period = 100", 
              "slowing down (end period = 105)"), 
   lty = 1, col = c("blue", "black", "red"))

Example output



WaveletComp documentation built on May 2, 2019, 6:33 a.m.