View source: R/hypothesis_testing.R
compute_B_pT | R Documentation |
B_{pT}
Statistic for Covariance Time-Variation Hypothesis TestingThis function calculates the B_{pT}
statistic, which is part of the hypothesis
testing procedure to determine whether the covariance matrix of asset returns is time-varying.
It incorporates kernel-weighted local and global factor interactions along with residuals.
compute_B_pT(local_factors, global_factors, residuals, h, iT, ip, kernel_func)
local_factors |
A list where each element is a numeric matrix representing the
local factor scores for a specific time period. Each matrix should have |
global_factors |
A numeric matrix of global factor scores with |
residuals |
A numeric matrix of residuals with |
h |
A numeric value indicating the bandwidth parameter for the kernel function. |
iT |
An integer specifying the number of time periods. |
ip |
An integer specifying the number of assets. |
kernel_func |
A function representing the kernel used for weighting. Typically, an Epanechnikov kernel or another boundary kernel function. |
The function performs the following steps:
Computes the sum of squared residuals for each time period s
.
Constructs the kernel matrix K[s,t]
by applying the boundary_kernel
function to each pair of time periods (s,t)
.
Calculates the local dot-product matrix L[s,t]
as the dot product between
the local factors at time s
and t
.
Computes the global dot-product matrix G[s,t]
as the dot product between
the global factors at time s
and t
.
Computes the element-wise squared difference between K * L
and G
,
multiplies it by the residuals, and sums over all s,t
.
Scales the aggregated value by \frac{\sqrt{h}}{T^2 \sqrt{p}}
to obtain B_{pT}
.
A numeric scalar B_{pT}
representing the computed statistic based on
kernel-weighted factor interactions and residuals.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.