Description Usage Arguments Details Value References Examples
Test for financial contagion by means of the local Gaussian correlation.
1 2 3 4 |
lg_object_nc |
An object of type |
lg_object_c |
An object of type |
grid_range |
This test measures the local correlations a long the diagonal specified by this vector of length two. |
grid_length |
The number of grid points. |
n_rep |
The number of bootstrap replicates. |
weight |
Weight function |
This function is an implementation of the test for financial contagion developed by Støve, Tjøstheim and Hufthammer (2013). They test whether the local correlations between two financial time series are different before and during crisis times. The distinction between crisis and non-crisis times must be made by the user.
A list containing the test result as well as various parameters. The elements are:
observed
The observed value of the test statistic.
replicated
The replicated values of the test statistic.
p_value
The p-value of the test.
local_correlations
The local correlations measured along the
diagonal, for the non-crisis and crisis periods respectively.
Støve, Bård, Dag Tjøstheim, and Karl Ove Hufthammer. "Using local Gaussian correlation in a nonlinear re-examination of financial contagion." Journal of Empirical Finance 25 (2014): 62-82.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # Run the test on some built-in stock data
data(EuStockMarkets)
x <- apply(EuStockMarkets, 2, function(x) diff(log(x)))[, 1:2]
# Define the crisis and non-crisis periods (arbitrarily for this simple
# example)
non_crisis <- x[1:100, ]
crisis <- x[101:200, ]
# Create the lg-objects, with parameters that match the applications in the
# original publication describibg the test
lg_object_nc <- lg_main(non_crisis, est_method = "5par",
transform_to_marginal_normality = FALSE)
lg_object_c <- lg_main(crisis, est_method = "5par",
transform_to_marginal_normality = FALSE)
## Not run:
# Run the test (with very few resamples for illustration)
test_result <- cont_test(lg_object_nc, lg_object_c,
n_rep = 10)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.