Frequently Asked Questions about S+FinMetrics
Time/Date Utility Functions
Q: How do I compute the number of days between two
dates according to different business conventions?
A: The days.count() function supports user-specified number of days in a year,
and number of days in a month. It can be used to
compute the difference of two dates according to a custom
specification.
Q: Are there any functions to generate IMM dates?
A: The imm.dates() function takes a starting date and ending date and computes
the IMM dates in this time period.
Q: How does bizTime() work?
A: The bizTime() function is used by the inhomogeneous moving average operators
for tick-by-tick data. It converts the time stamp information
into an index vector, skipping the market closing hours.
Time Series Manipulation and
Summary
Q: How do I deal with missing values in a time
series?
A: The interpNA() function can be used to interpolate the missing
values using the previous value, the next value, the
nearest value, linear interpolation, or cubic spline.
Q: How do I decompose an annual time series
into a monthly time series?
A: The function disaggregate() or interpNA() can be used to decompose a low frequency time series
into a high frequency time
series.
Q: How do I obtain a moving sample summary?
A: The functions SMA(), rollMax(), rollMin() and rollVar() can be used to obtain rolling mean, rolling max, rolling
min and rolling sample variance. The function aggregate() or roll() can also be used to obtain other rolling statistics.
Regression Models
Methods for the generic function IC(),
which computes various information criteria including
the log-likelihood value. So in many cases the likelihood
ratio test can be easily computed by comparing the log-likelihood
of two models.
Q: How do I compute Ljung-Box statistic?
A: The function autocorTest() can be used to compute Box-Pierce
or Ljung-Box statistic for univariate data, and their
counterparts for multivariate data.
Q: How do I compute Jarque-Bera test for normality?Q: Can I use distributed lags or polynomial
distributed lags?
A: The tslag() function can be used to create regressors using distributed
lags, while the pdl() function computes the polynomial
distributed lags of specified order.
Q: How do I get a Newey-West estimate?
Q: How do I get a Newey-West covariance matrix?
Q: How do I get a White estimate?
Q: How do I get a White covariance matrix?
A: The vcov() method for OLS objects, vcov.OLS(),
takes an optional argument "method", which
can be specified to generate
the White (HC) or Newey-West (HAC) covariance matrix.
For a univariate or multivariate time series, the asymp.var()
function can be used to compute the Newey-West long
run variance or covariance matrix.
Q: How do I perform a Wald test?
A: For OLS objects, you can use the waldTest() function to test arbitrary linear restrictions on the
coefficients. For other models, you can use the restriction
matrix together with the vcov() function to compute the Wald statistic.
Q: How do I perform a likelihood ratio test?
A: S+FinMetrics does not provide a function for
likelihood ratio tests directly. However, many model
objects have m
A: The function normalTest() can be used to compute both
Shapiro-Wilks normality test and Jarque-Bera normality
test.
Q: How do I test for heteraskedasticity?
A: The function heteroTest() can be used to test for heteroskedasticity in OLS residuals.
For a general time series, the function archTest() can be used to test for autoregressive heteroskedasticity.
Q: How do I perform multiple analyses over
a series of moving time windows?
A: The function rollOLS() implements an efficient algorithm for
rolling OLS analysis. The aggregate() function can be used to perform custom rolling sample
summaries, and the roll() function can be used to perform rolling analysis of
an arbitrary model.
Q: Can I estimate an SUR/SURE model in S+FinMetrics?
A: S+FinMetrics supports both linear and nonlinear
SUR/SURE models. Linearly constrained SUR models can
also be estimated using the NLSUR() function.
Q: Can I estimate a time varying parameter
regression?
A: A TVP regression can be easily estimated using
the state space modeling functions.
Time Series Models
Q: How do I compute the autocovariance/autocorrelation
function
of an ARMA model?
Q: How do I compute the autocovariance function
of a FARIMA model?
A: The acf() function in S-PLUS can be used to compute autocovariance,
autocorrelation, and partial autocorrelation for both
univariate and multivariate time series. The S+FinMetrics
function acf.FARIMA() can be used to compute the theoretical autocovariance
function of an ARMA or FARIMA model.
Q: How do I deal with level shifts and structural
changes in a time series?
A: The arima.rob() function can be used to estimate a (seasonal) ARIMA
model. As a side product, it also estimates additive
outliers, innovation outliers, and level shifts.
Q: How do I deal with outliers in a time series?
A: See the previous question. The state space
modeling functions can also be used to generate custom
analysis of the impacts of outliers.
Q: How do I test for long memory?
A: S+FinMetrics provides three tests for long
memory: the classical and modified R/S statistic, and
the GPH test. See the S+FinMetrics functions rosTest() and gphTest().
Q: How do I estimate the long memory parameter?
A: S+FinMetrics provides several methods for
estimating long memory parameters. See gphTest(), d.ros(), d.pgram(), d.whittle() and FARIMA().
Q: How do I perform Dickey-Fuller test for
unit root?
A: The unitroot() function can be used to compute the Dickey-Fuller test
or Phillips-Perron test.
Q: How do I perform KPSS test for stationarity?
A: The stationaryTest() function can be used to perform KPSS test.
Q: How do I test for cointegration?
A: The coint() function implements the Johansen tests for cointegration.
Q: How do I estimate a Vector Error Correction
Model (VECM)?
A: After applying the coint() function on a multivariate time series, you can call VECM() on the returned object to estimate a VECM.
Miscellaneous
Q: Can I fix a term structure model in S+FinMetrics?
A: The term.struct() function can be used to interpolate term structure data
using quadratic spline, cubic spline, Nelson-Siegel
function, extended Nelson-Siegel function, and smoothing
spline methods.
Q: How do estimate a factor model in S+FinMetrics?
A: The mfactor() function can be used to estimate a statistical multi-factor
model. If the number of assets is greater than the
number of observations, asymptotic principal component
analysis is used. Otherwise, the classical principal
component analysis is used.
Q: Can I estimate a model using GMM (Generalized
Method of Moments)?
A: Currently S+FinMetrics doesn't support GMM,
but this is planned for the next release.
Q: Where are the copula functions described?
A: The copula functions are provided by Professor
Rene Carmona at Princeton University. Currently he is
writing a book documenting the usage of copula functions
in S+FinMetrics.
Q: Where can I find more examples of using the
state space functions?
A: Professor Koopman at Free University, the
original author of the C library SsfPack,
is writing a book documentating the state space functions
in S+FinMetrics.
|