wolak {monotonicity} | R Documentation |
Testing inequality constraints in linear econometric models
Description
wolak
implements two tests from Wolak (1989, JoE) of inequality constraints in linear econometric models.
Test 1:
H0*: d1 >= 0, d2 >= 0, ..., dK >= 0
vs.
H1*: (d1, d2, ..., dK) in R^K, (ie: general alternative)
Test 2:
H0**: d1 = d2 = ... = dK = 0
vs.
H1**: d1 > 0, d2 > 0, ..., dK > 0.
Usage
wolak(data, increasing = TRUE, difference = FALSE, wolakRep = 100, zero_treshold = 1e-6)
Arguments
data |
an object of class |
increasing |
An object of class |
difference |
An object of class |
wolakRep |
A numeric scalar, stating the number of simulations to use to estimate the weight function in the weighted-sum of chi-square variables. |
zero_treshold |
A numeric scalar, being the treshold for comparing solution values of a non-linear optimization against zero. See section DETAILS for further information. |
Details
Currently supported as input type of data
are classes "matrix"
,
"data.frame"
, ts
, xts
and zoo
.
Using demo data shows for wolakRep
, that results do not change much at all for 100 or 1000 simulations, but the running time dramatically increases with the number of simulations. However, for robust results a minimum of 100 runs is highly recommended.
Internally, a non-linear optimization using "constrOptim"
is used for the Monte-Carlo simulation. The resulting values of the solution are close to zero, but due to the used machine precision numerically differnt from zero. For this reason, we suggest a treshold value close to zero. The default value is 1e-6
, so all resulting solutions smaller than the treshold value are treated as being zero. The default treshold value is consistent with the data-set and results of Patton and Timmermann (JoE, 2010). Of course, the appropriate treshold value can differ across applications (e.g. run the code on one set of data, and then the same data/100).
The HAC estimator of the covariance matrix of follows the adjustment of Newey-West (1987, 1994).
The kernel used is "Bartlett". See NeweyWest
for further information.
Value
wolak
returns an object of class
"list"
.
The returning list contains p-values for the following components:
TestOnePvalueWolak: |
p-value for |
TestTwoPvalueWolak: |
p-value for |
References
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
## load demo data and apply Wolak tests
data(demo_returns)
tmp <- wolak(demo_returns)
tmp$TestOnePvalueWolak
## transform existing data (asset returns) into difference returns before applying wolak()
## as data is finally in difference returns, appy wolak() with difference = TRUE
data <- demo_returns[, 2:ncol(demo_returns)] - (demo_returns[, 1:(ncol(demo_returns) - 1)])
wolak(data, difference = TRUE)