codis2d | R Documentation |
codis2d
calculates the synchronous and asynchronous codistribution
spectra.
codis2d( Mat, Ref = NULL, Wave = NULL, Time = NULL, Int = stats::splinefun, N = 2^ceiling(log2(NROW(Mat))), Norm = 1/(NROW(Mat) - 1), scaling = 0, corenumber = parallel::detectCores(), preview = FALSE )
Mat |
Numeric matrix containing the data which will be correlated; 'spectral variable' by columns and 'perturbation variables' by rows. |
Ref |
Numeric vector containing a single spectrum, which will be
subtracted from |
Wave |
Numeric vector containing the spectral variable. Needs to be
specified if column names of |
Time |
Numeric vector containing the perturbation variables. If
specified, |
Int |
Function specifying how the dataset will be interpolated to give
|
N |
Positive, non-zero integer specifying how many equally spaced
perturbation variables should be interpolated using |
Norm |
A number specifying how the correlation matrix should be normalized. |
scaling |
Positive real number used as exponent when scaling the dataset with its standard deviation. Defaults to 0 meaning no scaling. 0.5 (Pareto scaling) and 1 (Pearson scaling) are commonly used to enhance weak correlations relative to strong correlations. 2D codistribution spectroscopy is only strictly defined without the usage of any scaling techniques. Thus, any deviation from this definition can lead to unexpected results. |
corenumber |
Positive, non-zero integer specifying how many CPU cores should be used for parallel fft computation. |
preview |
Logical: Should a 3D preview of the asynchronous codistribution
spectrum be drawn at the end? Uses |
codis2d
calculates the the synchronous 2D correlation spectrum and
uses the 2D spectrum to calculate the synchronous and asynchronous
codistribution spectra. For parallelization the
parCapply
function is used. Large input matrices
(> 4000 columns) can lead to long calculation times depending on the
number of cores used. Also note that the resulting matrix can become
very large, adjust the RAM limit with memory.limit
accordingly. For a detailed description of the underlying math see
references.
codis2D
returns a list of class "corr2d" containing the complex
codistribution matrix ($FT
), the synchronous correlation spectrum
($corr), the used reference spectrum $Ref1
and $Ref2
, the
spectral variables $Wave1
and $Wave2
as well as the
(interpolated) perturbation variables ($Time
).
I. Noda (2014) <DOI:10.1016/j.molstruc.2014.01.024>
For plotting of the resulting list containing the 2D codistribution
spectra see plot_corr2d
and plot_corr2din3d
.
testdata <- sim2ddata(C = NULL, Camp = NULL) codis <- codis2d(testdata, corenumber = 1) plot_corr2d(codis, Im(codis$FT), xlab = expression(paste("Wavenumber" / cm^-1)), ylab = expression(paste("Wavenumber" / cm^-1)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.