IFSM: IFSM operator

View source: R/ifs.R

IFSMR Documentation

IFSM operator

Description

IFSM operator

Usage

IFSM(x, cf, a, s, k = 2)

Arguments

x

where to approximate the function

cf

the vector of coefficients phi_i

s

the vector of coefficients s_i in: w_i = s_i *x + a_i

a

the vector of coefficients a_i in: w_i = s_i *x + a_i

k

number of iterations, default = 2

Details

This operator is intended to approximate a function on L2[0,1]. If ā€˜uā€™ is simulated, then the IFSM can be used to simulate a IFSM version of ā€˜uā€™.

Value

The value of the approximate target function.

Author(s)

S. M. Iacus

References

Iacus, S.M, La Torre, D. (2005) IFSM representation of Brownian motion with applications to simulation, forthcoming.

Examples

require(ifs)

set.seed(123)
n <- 50
dt <- 1/n
t <- (1:n)*dt
Z <- rnorm(n)
B <- sqrt(dt)*cumsum(Z)

ifsm.w.maps() -> maps
a <- maps$a
s <- maps$s

ifsm.setQF(B, s, a) -> QF
ifsm.cf(QF$Q,QF$b,QF$L1,QF$L2,s)-> SOL
psi <- SOL$psi

t1 <- seq(0,1,length=250)
as.numeric(sapply(t1, function(x) IFSM(x,psi,a,s,k=5))) -> B.ifsm
old.mar <- par()$mar
old.mfrow <- par()$mfrow
par(mfrow=c(2,1))
par(mar=c(4,4,1,1))
plot(t1,B.ifsm,type="l",xlab="time",ylab="IFSM")
plot(t,B,col="red",type="l",xlab="time",ylab="Euler scheme")
par(mar=old.mar)
par(mfrow=old.mfrow)

ifs documentation built on Sept. 9, 2022, 3:09 p.m.

Related to IFSM in ifs...