Description Usage Arguments Details Value Author(s) See Also Examples
Given a time series and a collection of possible factors, finds a subset of the factors that provides the best fit to the given time series using the partially cointegrated model.
1 2 3 4 5 6 7 8 9 10 |
Y |
An |
X |
An |
maxfact |
The maximum number of columns from |
lambda |
A penalty to be applied to the random walk
portion of the partialAR model. A positive value for |
use.multicore |
If |
minimum.stepsize |
If this is non-NA, then the search stops if an improvement cannot be found of at least this much. Default: 0 |
verbose |
If |
exclude.cols |
A list of column indexes specifying columns from |
search_type |
If "lasso", then the lasso algorithm (see |
pci_opt_method |
Specifies the method that will be used for finding the best fitting model. One of the following:
Default: |
... |
Other parameters to be passed onto the search function. See the source code. |
The hedge is constructed by searching for column indices i1,i2, ..., iN
from among the columns of X
which yield the best fit to the partially
cointegrated fit:
Y[t] = + beta[1] * X[t,i1] + beta[2] * X[t,i2] + ... + beta[k] * X[t,iN] + M[t] + R[t]
M[t] = rho * M[t-1] + epsilon_M[t]
R[t] = R[t-1] + epsilon_R[t]
-1 < rho < 1
epsilon_M[t] ~ N(0, sigma_M^2)
epsilon_R[t] ~ N(0, sigma_R^2)
if search_type="lasso"
is specified, then the lasso algorithm
(see glmnet
) is used to search for the factors that give
the best linear fit to the target sequence Y
. Having determined
the list of factors, the cutoff point is determined based successive
improvements to the likelihood score of the fitted model.
Otherwise, a greedy algorithm (search_type="full"
) or a modified greedy algorithm
(search_type="limited"
) is used. This proceeds by searching through all
columns of X
(except those listed in exclude.cols
) to find the
column that gives the best fit to Y
, as determined by
the likelihood score of the partially cointegrated model. This column becomes the initial
hedging portfolio. Having selected columns i1, i2, ..., iK
, the next
column is found by searching through all remaining columns of X
(except those
listed in exclude.cols
) for the column which gives the best improvement
to the partially cointegrated fit. However, if the best improvement is less than
minimum.stepsize
, or if maxfact
columns have already been added,
then the search terminates.
In the case of the modified greedy algorithm (search_type="limited"
), a
preprocessing step is used at the beginning of each iteration. In this preprocessing
step, the correlation is computed between each unused column of X
and the
residual series of the currently computed best fit. The top B
choices are then
considered for inclusion in the portfolio, where B
is a branching factor.
The branching factor can be controlled by setting the value of the optional parameter
max.branch
. Its default value is 10.
The lasso
algorithm is by far the fastest, followed by the limited
greedy search.
So, the best strategy is probably to start by using the lasso
. If it fails to
produce acceptable results, then move on to the limited
greedy algorithm and finally
the full
search.
Returns an S3 object of class pci.hedge
containing the following fields
pci |
The best partially cointegrated fit that was found |
indexes |
The indexes of the columns from |
index_names |
The names of the columns from |
Matthew Clegg matthewcleggphd@gmail.com
Christopher Krauss christopher.krauss@fau.de
Jonas Rende jonas.rende@fau.de
fit.pci
Fitting of partially cointegrated models
partialAR
Partially autoregressive models
egcm
Engle-Granger cointegration model
1 2 3 4 5 6 7 8 9 10 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## Not run: YX <- rpci(n=1000, beta=c(2,3,4,5,6),
sigma_C=c(0.1,0.1,0.1,0.1,0.1), rho=0.9, sigma_M=1, sigma_R=1)
YXC <- cbind(YX, matrix(rnorm(5000), ncol=5))
hedge.pci(YX[,1], YX[,2:ncol(YX)])
hedge.pci(YXC[,1], YXC[,2:ncol(YXC)])
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.