DSFM1D: Estimation of Dynamic Semiparametric Factor Model for...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/DSFM_1D.R

Description

DSFM1D performs a model estimation using Dynamic Semiparametric Factor mechanics with one-dimensional covariates. This function is called by the DSFM main function.

Usage

1
2
DSFM1D(data, numDataPoints = 25, h = 0.5, L = 3, initialLoad = "WN",
  tol = 1e-05, maxIt = 301)

Arguments

data

a matrix containing time indicator in first row, value Y_{t,j} in second row, and the coordinates X_{t,j} in the remaining row. Proper formatting has to be done using the DSFM1DData.

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 either a single global parameter, or a vector of the same length of numDataPoints to perform local kernel estimation.

L

the number of underlying factors.

initialLoad

the type of initial loadings to choose between White Noise "WN", and AR(1) process "AR". Required as starting value of the algorithm. Changing the initialLoad can sligthly improve the convergence rate.

tol

the tolerance for the algorithm to stop.

maxIt

the maximum number of iterations for the algorithm to break.

Details

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.

Value

DSFM1D returns an object of class "DSFM1D".

The generic functions print, summary, plot and predict are available.

An object of class "DSFM1D" is a list containing the following components:

data

the input data.

Y

the input data in a more usual format, i.e. a matrix with a time indicator as first row and the following rows being the value Y_{t,j} for each covariates X_{t,j}.

YHat

the estimated \hat{Y}_{t,j} with the same format, i.e. a matrix with a time indicator as first row and the following rows being the value \hat{Y}_{t,j} for each covariates X_{t,j}.

ZHat

the estimated factor loadings \hat{Z}_{t,j}.

mHat

the estimated factor functions \hat{m}_l.

residuals

the error terms.

EV

gives the Explained Variance, used to select the approriate number of factors.

RMSE

gives the Root Mean Squared Error, used to compare models.

AIC

gives the bandwidth h used and two selection criteria to select the optimal bandwidth.

bandwidth

the vector of bandwidths used at each kernel point.

x1

the vector of the covariates.

density

the kernel density estimation performed.

convergence

the value of the algorithm stopping criterion at each loop.

time

an indicator of the time taken by the function to perform the fit.

Author(s)

The implementation of model by Marc Gumowski was based on Fengler and al. (2007).

References

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.

See Also

summary.DSFM1D for summaries and plot.DSFM1D for plot possibilities.

predict.DSFM1D provide succint predictions.

DSFM1DData has to be used before using the DSFM function to ensure that the data are correctly formated.

simulateDSFM1D is a function to simulate data that can be used as simple example purposes.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Prepare the data --------------------------------------------------------- #
# Interest rate of zero-coupon bond yield curves. Data from Bank of Canada.
data(canadianYieldCurves)
maturity <- c(1/4, 1/2, 3/4, 1:10, 20, 30)
dsfmData <- DSFM1DData(canadianYieldCurves[1:400, ], maturity)
dsfmData
plot(dsfmData)

# Set the parameters ------------------------------------------------------- #
h        <- 0.167
L        <- 3

# Fit the model ------------------------------------------------------------ #
dsfmFit  <- DSFM(dsfmData, h = h, L = L)
summary(dsfmFit)
plot(dsfmFit)

# Perform prediction ------------------------------------------------------- #
horizon  <- 5
predict(dsfmFit, nAhead = horizon)

MarcGumowski/dysefamor documentation built on May 7, 2019, 2:47 p.m.