Learn R Programming

eventstudies (version 1.2.2)

lmAMM: Augmented market model (AMM) estimation

Description

‘lmAMM’ (linear augmented market models) estimates exposure and residuals.

Usage

lmAMM(firm.returns, X, nlags = NULL, verbose = FALSE)

Arguments

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.

Value

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.

Details

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.

See Also

makeX lm

Examples

Run this code
# NOT RUN {
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="")
# }

Run the code above in your browser using DataLab