localgaussSpec | R Documentation |
A package for the investigation of univariate and multivariate time series by means of Local Gaussian (auto- and cross-) correlations, and the corresponding spectral densities.
The localgaussSpec
-package investigates strictly stationary
time series by the help of a local Gaussian approach. This implies
that local Gaussian auto- and cross-correlations are computed for a
selection of lags and a selection of points – and based on this it
is then possible to investigate the corresponding (m-truncated)
local Gaussian spectra. The local Gaussian correlation coincides
with the ordinary correlation when a Gaussian structure is
investigated, which implies that it is of interest to compare the
ordinary spectra and the local Gaussian spectra since that can
reveal the presence of non-Gaussian dependency structures in the
time series under investigation.
The scripts that are included in this package provide a simple way to see how the different key-functions should be put together in order to investigate both simulated and real examples. These scripts are included in order to allow interested readers to reproduce the results and figures in the papers based on this local Gaussian approach, but they can easily be modified in order to investigate similar investigations for other cases.
The scripts for the simulated time series are based on the
following sequence of steps and key functions. The
localgaussSpec
package must be loaded, and a
main_dir
-argument must be specified. The function
TS_sample
is then called in order to create the desired
collection of samples, and this is done by the help of a
TS_key
-argument and parameters suitable for this particular
key. The required generating functions is part of an internal list
called TS_family
, and this list can be extended on demand.
Based on the generated time series, a unique save_dir
is
computed, and the function TS_LG_object
is then used to
initiate a file-hierarchy, in which the results of the local
Gaussian investigation will be stored. The next step is then to
specify some details related to the tuning parameters for the
estimation algorithm, and for this part the function
LG_select_points
can be used to specify different
configurations of the points to be investigated (e.g. points along
the diagonal or points in a rectangular grid). After this, the
scribe-function LG_approx_scribe
is called in order to
perform assorted tasks related to the computation, including a
simple check that can prevent previously computed tasks to be
recomputed. If a new computation is encountered, then the
scribe-function will save the resulting data into the file
hierarchy. The scribe will return a main_dir
-argument and a
data_dir
-argument, which is needed in order for
LG_shiny
to start a shiny
-application that enables an
interactive inspection of the resulting local Gaussian auto- and
cross-correlations, together with different graphical
visualisations of the corresponding local Gaussian spectra.
The scripts for the real samples are quite similar to those
described for the simulated time series. An obvious difference is
that TS_sample
should not be used, since a sample after all
is present. This real sample is sent into TS_LG_object
,
which creates a unique save_dir
based on the given
observations. After this the same procedure is applied with regard
to selecting the tuning parameters for the local Gaussian
estimation, and LG_approx_scribe
is used on the single
sample. After this, the function LG_boot_approx_scribe
can
be used to produce resampled versions of the time series, and based
on the local Gaussian estimates from these resampled versions it is
then possible to obtain pointwise confidence intervals for the
estimates based on the original sample. This scribe-function will
also return a main_dir
-argument and a
data_dir
-argument, in order for the LG_shiny
-function
to start the interactive shiny
-investigation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.