add.price: Add price response

Description Usage Arguments Value Examples

Description

Add price response to the series regarding the parameters

Usage

1
add.price(tser, elast, random.price=FALSE, inf.limit=NULL, sup.limit=NULL, p.vec=NULL)

Arguments

tser

time series which price response will be added

elast

can be either a number, or a vector. If it's a vector, a loess will be adjusted to it, generating values of seasonality for each observation.

random.price

TRUE or FALSE depending on whether the price should be random, or a loess fitted vector.

inf.limit

inferior limit of price when it's random.

sup.limit

superior limit of price when it's random.

p.vec

vector of prices to be fitted by loess

Value

returns the time series with price response

Examples

1
2
3
4
5
6
set.seed(123)
kp <- c(100,110,140,120,90)
bs <- basic.series(kp, start=c(2008,1))
bss <- add.season(bs)
add.price(bss, -2, random.price=TRUE, 2, 10)
add.price(bss, c(-2,-3,-2,-1), random.price=FALSE, p.vec=c(4,2,5,7,10))

jdanielnd/tsgen documentation built on May 18, 2019, 10:26 p.m.