Description Usage Arguments Details Value Warning Author(s) Examples
‘makeX’ is used to prepare regressors for computation of Augmented Market Models. It can be used to create a matrix of explanatory variables in the form specified by the user for estimation of AMM.
1 2 3 4 5 6 7 |
market.returns |
a univariate timeseries object of ‘class’ zoo. In market models, this is normally the returns of a stock market index. |
others |
a zoo matrix of other regressors for the multiple regression model. |
switch.to.innov |
a ‘logical’ vector with an element for each column in “others” specifying whether to switch the column from raw values to auto-regressive residuals. Default is ‘TRUE’ for all the columns. See ‘Details’. |
market.returns.purge |
a ‘logical’ indicating whether to purge the effects of “others” from “market.returns”. See ‘Details’. |
nlags |
a integer specifying the number of lags required when ‘market.returns.purge’ is ‘TRUE’. |
dates |
a ‘Date’ vector, default set to ‘NULL’, specifying breaks. See ‘Details’. |
verbose |
a ‘logical’ value, with the default being ‘FALSE’, specifying whether detailed output is required. |
This function prepares the regressors of interest for the purpose of running aumgmented market models.
The ‘logical’ vector ‘switch.to.innov’ is applicable only to the regressors in ‘others’ matrix and not to the time series vector in ‘market.returns’.
When ‘market.returns.purge’ is ‘TRUE’, residuals from a regression of ‘market.returns’ on ‘others’ is obtained. If ‘dates’ are provided, this regression is done within sub-periods as identified by the ‘dates’ vector. When ‘dates’ is set to default value of ‘NULL’, the start and end points of ‘market.returns’ is taken as the period for estimation.
a time-series object of regressors is returned.
The input data should not contain ‘NA’s, as is required by the “lm” function to estimate a linear regression. Please use ‘na.omit’ before feeding data into this function.
Ajay Shah, Chirag Anand, Vikram Bahure, Vimal Balasubramaniam
1 2 3 4 5 6 7 8 9 10 | data("OtherReturns")
market.returns <- OtherReturns$NiftyIndex
currency.returns <- OtherReturns$USDINR
X <- makeX(market.returns,
others = currency.returns,
switch.to.innov = FALSE,
market.returns.purge = FALSE,
verbose = FALSE)
head(na.omit(X))
|
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: xts
market.returns z
2010-07-01 -1.15678265 0.30097847
2010-07-02 -0.27267977 0.00000000
2010-07-05 -0.02291607 0.40702721
2010-07-06 1.00998963 -0.01069004
2010-07-07 -0.91072457 0.53310725
2010-07-08 1.05809043 -0.34726333
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.