Description Usage Arguments Details Value Author(s) References See Also Examples
DSFM2D
performs a model estimation using Dynamic Semiparametric Factor
mechanics with two-dimensional covariates. This function is called by the
DSFM
main function.
1 2 |
data |
a matrix containing time indicator in first row, value
Y_{t,j} in second row, and the coordinates X_{t,j} in the two
remaining rows. Proper formatting has to be done using the
|
numDataPoints |
the number of points in the axis of the grid to perform the kernel density estimation. |
h |
the bandwidth used to perform the kernel density estimation. can be a single global parameter, a vector of two bandwidths (one by dimension) or a matrix of size numDataPoints x 2 for local bandwidth. |
L |
the number of underlying factors. |
initialLoad |
the type of initial loadings to choose between White Noise
|
tol |
the tolerance for the algorithm to stop. |
maxIt |
the maximum number of iterations for the algorithm to break. |
Dynamic Semiparametric Factor Models (DSFM) are defined as Y_{t,j} = m_0(X_{t,j}) + ∑_{l=1}^L Z_{t,l} m_l(X_{t,j}) + \varepsilon_{t,j}. DSFM estimation is performed using kernel density for the non-parametric functions m_l. The estimation is performed using the iterative algorithm of Fengler and al. (2007).
The function has predefined arguments that can be changed for better approximation. First, the number of data points on the estimation grid is set to 25. Larger grid can significantly increase the computation time without necesseraly improve the fit. Secondly, the bandwidth h is basically set to 0.05 but optimal bandwidth has to be found externally. The algorithm always normalize the covariates to work on an estimation grid bounded beetween [0,1].
For model selection, different criteria are computed.
For number of factors selection, the function compute the Explained Variance, for bandwidth selection, two criteria are computed, a weighted Akaike Information Criterion (AIC) and a weighted Schwarz Criterion (SC). The goodness-of-fit is measured by the Root Mean Squared Error (RMSE). The proper definition of each criterion can be found in references.
DSFM2D
returns an object of class "DSFM2D"
.
The generic functions print
,summary
, plot
and
predict
are available.
An object of class "DSFM2D"
is a list containing the following
components:
|
the input data. |
|
the estimated \hat{Y}_{t,j}. |
|
the estimated factor loadings \hat{Z}_{t,j}. |
|
the estimated factor functions \hat{m}_l. |
|
the error terms. |
|
gives the Explained Variance, used to select the approriate number of factors. |
|
gives the Root Mean Squared Error, used to compare models. |
|
gives the bandwidth h used and two selection criteria to select the optimal bandwidth. |
|
the kernel density estimation performed. |
|
the value of the algorithm stopping criterion at each loop. |
|
an indicator of the time taken by the function to perform the fit. |
The implementation of model by Marc Gumowski was based on Fengler and al. (2007).
Borak, Szymon, Matthias R. Fengler, and Wolfgang K. Haerdle (2005)."DSFM Fitting of Implied Volatility Surfaces". In: 5th International Conference on Intelligent Systems Design and Applications (ISDA'05), pp. 526-531. IEEE.
Fengler, Matthias R, Wolfgang K Haerdle, and Enno Mammen (2007). "A Semiparametric Factor Model for Implied Volatility Surface Dynamics". In: Journal of Financial Econometrics 5.2, pp. 189-218.
Haerdle, Wolfgang K., and Piotr Majer (2014). "Yield Curve Modeling and Forecasting using Semiparametric Factor Dynamics". In: The European Journal of Finance, pp. 1-21.
summary.DSFM2D
for
summaries and plot.DSFM2D
for plot
possibilities.
predict.DSFM2D
provide succint
predictions.
DSFM2DData
has to be used before
using the DSFM
function to ensure that the data are correctly
formated.
simulateDSFM2D
is a function to simulate data that can be used
as simple example purposes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | # Prepare the data --------------------------------------------------------- #
simulatedData <- simulateDSFM2D()
dsfmData <- simulatedData$dataSim
dsfmData
# Set the parameters ------------------------------------------------------- #
h <- c(0.05, 0.05)
L <- 4
# Fit the model ------------------------------------------------------------ #
dsfmFit <- DSFM(dsfmData, h = h, L = L)
summary(dsfmFit)
plot(dsfmFit)
# Perform prediction ------------------------------------------------------- #
horizon <- 5
predict(dsfmFit, nAhead = horizon)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.