monoUpDown: Up and Down test

Description Usage Arguments Value References Examples

View source: R/monoUpDown.R

Description

monoUpDown implements the 'Up and Down' tests from Patton & Timmermann (2010, JFE) based on:

(1) sum of squared differences for positive diffs and negative diffs, (2) sum of absolute differences for positive diffs and negative diffs,

and uses the stationary bootstrap method from Politis & Romano (1994, JASA).

Usage

1
monoUpDown(data, difference = FALSE, bootstrapRep = 1000, block_length)

Arguments

data

an object of class "matrix" (or one that can be coerced to that class): asset returns or differences in asset returns which are sorted in a maximum of 15 portfolios. Each column of the matrix 'data' represents a single portfolio. data is therefore limited to a 15 columns.

difference

An object of class "logical": If data is already differences in asset returns, use TRUE. Otherwise data will be transformed to difference returns r_p(n+1) - r_p(n) between portfolio n+1 and portfolio n

bootstrapRep

A numeric scalar: the number of bootstrap samples.

block_length

A numeric scalar: The average length of the block to usefor the stationary bootstrap. This parameter is related to how much serial correlation is in your data. Use 10/6/3/2 as the block length if data is measured in daily/monthly/quarterly/annual returns.

Value

monoUpDown returns an object of class "matrix":

"matrix":

A named 4x2 matrix with the bootstrap p-values from a test for a monotonic relationship. The first row contains p-values for squared diffs in an assumed increasing monotonic pattern, the second row respectively for a decreasing pattern. The third row contains p-values for absolute differences in an assumed increasing monotonic pattern, the fourth row respectively for a decreasing pattern. The first column gives p-values which are not studentised, the second column the equivalent studentised p-values.

References

Patton, A. and Timmermann, A. (2010): Monotonicity in asset returns: New testes with applications to the term structure, the CAPM, and portfolio sorts. Journal of Financial Economics, 98, No. 3, p. 605–625. doi: 10.1016/j.jfineco.2010.06.006.

Wolak, Frank A. (1989): Testing Inequality Constraints in Linear Econometric Models. Journal of Econometrics, 41, p. 205–235. doi: 10.1016/0304-4076(89)90094-8.

Examples

1
2
3
## load demo data and apply monoUpDown with daily data, which are not yet in differences
data(demo_returns)
test <- monoUpDown(demo_returns,block_length = 10)

skoestlmeier/monotonicity documentation built on Dec. 29, 2021, 9:54 a.m.