Description Usage Arguments Details Value Author(s) See Also Examples
‘lmAMM’ (linear augmented market models) estimates exposure and residuals.
1 |
firm.returns |
a univariate ‘zoo’ object of data for one regressor (firm). |
X |
a matrix of regressors obtained by using ‘makeX’. See ‘Details’ when this is specified as a market model. |
nlags |
specifies a lag length required from the specified set of regressors. When unspecified, the best lag using the AIC is used. |
verbose |
‘logical’. If ‘TRUE’, prints details of piece-wise analysis. |
This function estimates a linear regression model with multiple variables using ‘lm’, stores coefficients as ‘exposures’, and HAC adjusted standard errors as ‘s.exposures’.
This function is the core engine for other functions that estimate AMMs. Each regression is expected in this package to have a minimum of 30 observations, a condition that translates into a month of daily data. If the total number of observations is less than 30, the function returns ‘NULL’.
Function ‘makeX’ is used to obtain a matrix of regressors used as input for ‘X’.
If “nlags” is ‘NULL’, then the function finds the best lag structure using the AIC(n).
‘lmAMM’ calls stats::lm
to estimate the linear model.
‘print’ function on an object of ‘class’
“amm” can be used to see the call (formula) to lm
.
The function returns an object of ‘class’
“amm”; ‘NULL’ if nrow(firm.returns) < 30
.
Function ‘summary’ is provided to print a summary of results. ‘print’ prints the coefficients and exposures of the analysis. ‘plot’ plots the model residuals and firm returns.
An object of class “amm” is a ‘list’ containing the
output of stats::lm
(which includes “residuals”),
along with the following components:
exposures |
a ‘numeric’ containing exposure estimates for the firm. |
s.exposures |
a ‘numeric’ containing HAC adjusted standard error of the exposures estimated for the firm. |
nlags |
shows the lag length provided by user. |
Ajay Shah, Chirag Anand, Vikram Bahure, Vimal Balasubramaniam
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | data("StockPriceReturns")
data("OtherReturns")
firm.returns <- StockPriceReturns[, "Infosys"]
market.returns <- OtherReturns[ ,"NiftyIndex"]
currency.returns <- OtherReturns[, "USDINR"]
X <- makeX(market.returns,
others = currency.returns,
switch.to.innov = FALSE,
market.returns.purge = FALSE,
nlags = 4,
verbose = FALSE)
amm.result <- lmAMM(firm.returns, X, nlags = 3, verbose = FALSE)
plot(amm.result)
amm.residual <- residuals(amm.result)
amm.residual <- zoo(amm.residual,
order.by = as.Date(names(amm.residual)))
Comparison <- merge(AMMResidual = amm.residual,
Infosys = StockPriceReturns$Infosys,
NiftyIndex = OtherReturns$NiftyIndex,
all = FALSE)
plot(Comparison, xlab="")
|
Loading required package: zoo
Attaching package: ‘zoo’
The following objects are masked from ‘package:base’:
as.Date, as.Date.numeric
Loading required package: xts
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.