add_trend: add trend of order trend_order

Description Usage Arguments Value

View source: R/add_trend.R

Description

A function for adding trends to the dataset. This function helps the user add deterministics to the original dataset prior to modeling. The function allow for adding, trends, broken trends and permanent dummies through the use of the start_date and end_date inputs. The only type of dummy that cannot be added using this function is the transitory dummy (a blip dummy). A specific function for handling that case is provided, see add_transitory_dummy.

The function is quite simple and can easily be replicated by the user. I adds a column to the data set named 'x_...'. If the user wishes to add the column on his own, this can be done without any complications for further analysis as long as the user applies correct naming principles, using the 'x_' prefix.

Usage

1
2
add_trend(data, trend_order, name, start_date = head(index(data), 1),
  end_date = tail(index(data), 1), restricted = FALSE)

Arguments

data

the original dataset to which a trend should be added

trend_order

the order of the trend

name

is the name (excluding the prefix 'x_') of the constructed trend variable.

start_date

the start date for the trend, default is the date of the first observation of the data table.

end_date

the end date for the trend is the date at which the trend ends.

restricted

a boolean variable to indicate whether the included trend is to be restricted to lie in the cointegration space. Default is FALSE.

Value

the input dataset with an added column including a trend


EmilNejst/Rcivecm documentation built on May 6, 2019, 3:47 p.m.