iteratedMap: Time series creation by given map.

Description Usage Arguments Details Value Author(s) Examples

View source: R/iteratedMap.R

Description

Time series creation by given map.

Usage

1
iteratedMap(n, x0, fun, skipFirst = TRUE)

Arguments

n

integer - length of resulting time series.

x0

double - initial condition.

fun

function of one parameter - the corresponding map.

skipfirst

logical - wether the initial condition is to be removed.

Details

This routine takes a map and applies it iteratively.

Value

vector of type double and length n - the resulting time series.

Author(s)

Philipp van Wickevoort Crommelin

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
N = 12
x = seq(from = 0,
       to = 1,
       by = 1/(N-1))
y = stats::runif(N)
fun = stats::approxfun(x = x,
                      y = y,
                      method = "linear")
x0 = 0.2
par(mfrow = c(2,1))
plot(x = x,
    y = y,
    main = "map",
    type = "l",
    col = "lightblue",
    lwd = 7,
    ylab = "")
N_series = 30
tmser = myBayes::iteratedMap(n = N_series,
                   x = x0,
                   fun = fun,
                   skipFirst = FALSE)
plot(NULL,
    xlim = c(1,N_series),
    ylim = c(1,0),
    main = "Time series",
    xlab = "iteration",
    ylab = "")
lines(x = 1:N_series,
     y = tmser,
     col = "purple",
     lwd = 5,
     ylab = "")
points(x = 1:N_series,
      y = tmser,
      col = "orange",
      cex = 2,
      pch = 16)

PhilippVWC/myBayes documentation built on Oct. 2, 2020, 8:25 a.m.