ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
AutoCorr Class Reference

This is the base class for generating objects containing information about autocorrelation of the input data and tools for visualizing it.
More...

Inheritance diagram for AutoCorr:
Collaboration diagram for AutoCorr:

Public Member Functions

function AutoCorr (in dfref, in numlag, in numstd)
 Return an object of class pm.stats.AutoCorr.
This is the constructor of the pm.stats.AutoCorr class.
More...
 
function get (in self, in dfref, in numlag, in numstd)
 Return the autocorrelation of the input data from a lag of 0 to numlag.
More...
 
function setvis (in self, in val)
 Set up the visualization tools of the autocorrelation.
More...
 

Data Fields

Property dfref
 
Property numlag
 
Property numstd
 
Property bnd
 
Property val
 
Property vis
 

Detailed Description

This is the base class for generating objects containing information about autocorrelation of the input data and tools for visualizing it.

Note
This is convenience class for easy computation of autocorrelation and its storage all in one place.
The primary advantage of this class over the MATLAB intrinsic functions is in the ability of this class to compute the result for input dataframe table and return the results always in MATLAB table format.
See the documentation of the class constructor pm.stats.AutoCorr::AutoCorr below.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:06 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

Definition at line 24 of file AutoCorr.m.

Constructor & Destructor Documentation

◆ AutoCorr()

function AutoCorr::AutoCorr ( in  dfref,
in  numlag,
in  numstd 
)

Return an object of class pm.stats.AutoCorr.
This is the constructor of the pm.stats.AutoCorr class.

Parameters
[in]dfref: The input MATLAB matrix or table of rank 2 containing the data as ncol columns of nrow observations whose autocorrelation must be computed.
Ideally, the user would want to pass a reference to a dataframe (e.g., as a function handle @()df) so that the data remains dynamically up-to-date.
(optional. If missing, the autocorrelation will not be computed.)
[in]numlag: The input scalar MATLAB positive whole number representing the number of lags for which the autocorrelation must be computed.
This argument is directly passed to the corresponding argument of the MATLAB intrinsic autocorr() in the MATLAB Econometrics Toolbox.
[in]numstd: The input positive scalar MATLAB double representing the number of standard deviations to be used in computing the lower and upper significance levels of the autocorrelation.
This argument is directly passed to the corresponding argument of the MATLAB intrinsic autocorr() in the MATLAB Econometrics Toolbox.
(optional, default = 1)
Returns
self : The output object of class pm.stats.AutoCorr.


Possible calling interfaces

acf = pm.stats.AutoCorr()
acf = pm.stats.AutoCorr([])
acf = pm.stats.AutoCorr(dfref)
acf = pm.stats.AutoCorr(dfref, numlag)
acf = pm.stats.AutoCorr(dfref, [], numstd)
acf = pm.stats.AutoCorr(dfref, numlag, numstd)
Property numstd
Definition: AutoCorr.m:59
Property numlag
Definition: AutoCorr.m:48
Property dfref
Definition: AutoCorr.m:38


Example usage

1cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
2addpath('../../../'); % Add the ParaMonte library root directory to the search path.
3
4pm.matlab.show()
5pm.matlab.show('acf = pm.stats.AutoCorr(unifrnd(0, 1, 1000, 4));')
6 acf = pm.stats.AutoCorr(unifrnd(0, 1, 1000, 4));
7
8pm.matlab.show('acf.vis.plot.line.make(); %yline(acf.bnd); yline(-acf.bnd);')
9 acf.vis.plot.line.make(); %yline(acf.bnd); yline(-acf.bnd);
10pm.matlab.show('acf.vis.plot.line.savefig("AutoCorr.unifrnd.plot.line.png", "-m3");')
11 acf.vis.plot.line.savefig("AutoCorr.unifrnd.plot.line.png", "-m3");
12
13pm.matlab.show('acf.vis.tile.line.make();')
14 acf.vis.tile.line.make();
15pm.matlab.show('acf.vis.tile.line.savefig("AutoCorr.unifrnd.tile.line.png", "-m3");')
16 acf.vis.tile.line.savefig("AutoCorr.unifrnd.tile.line.png", "-m3");
17
18pm.matlab.show('acf.vis.cascade.line.make();')
19 acf.vis.cascade.line.make();
20pm.matlab.show('acf.vis.cascade.line.savefig("AutoCorr.unifrnd.cascade.line." + string([1, 2, 3, 4]) + ".png", "-m3");')
21 acf.vis.cascade.line.savefig("AutoCorr.unifrnd.cascade.line." + string([1, 2, 3, 4]) + ".png", "-m3");
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.

Visualization of the example output












Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:10 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

Member Function Documentation

◆ get()

function AutoCorr::get ( in  self,
in  dfref,
in  numlag,
in  numstd 
)

Return the autocorrelation of the input data from a lag of 0 to numlag.

This is a dynamic method of the pm.stats.AutoCorr class.
This method automatically stores any input information in the corresponding components of the parent object.
However, any components of the parent object corresponding to the output of this method must be set explicitly manually.

Parameters
[in,out]self: The input/output parent object of class pm.stats.AutoCorr which is implicitly passed to this dynamic method (not by the user).
[in]dfref: The input MATLAB matrix or table of rank 2 containing the data as ncol columns of nrow observations whose autocorrelation must be computed.
Ideally, the user would want to pass a reference to a dataframe (e.g., as a function handle @()df) so that the data remains dynamically up-to-date.
(optional. If missing, the contents of the corresponding internal component of the parent object will be used.)
[in]numlag: The input positive scalar MATLAB integer representing the number of lags to be used in computing the autocorrelation.
The default value will be used if the input numlag is unspecified or empty [].
(optional, default = size(dfref.copy(), 1) - 1)
[in]numstd: The input positive scalar MATLAB double representing the number of standard deviations to be used in computing the lower and upper significance levels of the autocorrelation.
This argument is directly passed to the corresponding argument of the MATLAB intrinsic autocorr() in the MATLAB Econometrics Toolbox.
The default value will be used if the input numstd is empty [].
(optional, default = 1)
Returns
val : The output MATLAB table of size numlag + 1 containing the autocorrelation from lag 0 to numlag.
The first column of val always contains the set of numlag + 1 autocorrelation lags from 0 to numlag.
bnd : The output MATLAB table of size(dfref.copy(), 2) rows by one column containing the absolute numstd-significance level of the computed autocorrelations. Any autocorrelation value whose magnitude is smaller than the corresponding bnd element can be considered insignificant and mere fluctuation.


Possible calling interfaces

acf = pm.stats.AutoCorr()
[acf.val, acf.bnd] = acf.get(dfref)
[acf.val, acf.bnd] = acf.get(dfref, [])
[acf.val, acf.bnd] = acf.get(dfref, numlag)
[acf.val, acf.bnd] = acf.get(dfref, [], numstd)
[acf.val, acf.bnd] = acf.get(dfref, numlag, numstd)
Note
See the documentation of the class constructor pm.stats.AutoCorr for example usage.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Joshua Alexander Osborne, May 21 2024, 4:14 AM, University of Texas at Arlington
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

◆ setvis()

function AutoCorr::setvis ( in  self,
in  val 
)

Set up the visualization tools of the autocorrelation.

This is a dynamic Hidden method of the pm.stats.AutoCorr class.
This method is inaccessible to the end users of the ParaMonte MATLAB library.

Parameters
[in,out]self: The implicitly-passed input argument representing the parent object of the method.
[in]val: The input (reference of function handle returning a) MATLAB matrix or table of rank 2 containing the computed autocorrelation to be visualized.
Ideally, the user would want to pass a reference to a dataframe (e.g., as a function handle @()df) so that the data remains dynamically up-to-date.
(optional. If missing, the contents of the corresponding var attribute of the parent object will be used.)


Possible calling interfaces

acf = pm.stats.AutoCorr(dfref, method)
acf.setvis(); % This method is automatically called within the object constructor.


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Fatemeh Bagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.
Amir Shahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin

Field Documentation

◆ bnd

Property AutoCorr::bnd

bnd

The MATLAB table of rank 2 serving as a convenient storage component each column of which corresponds to the absolute numstd-significance bound for the corresponding computed autocorrelations of the input data (that is optionally stored in the val component of the parent object).
The values represent the numstd-sigma standard errors on the computed autocorrelations.
Any autocorrelation value bound within these limits can be considered random fluctuations at numstd-sigma confidence level.
This component is automatically populated when constructing an object of class pm.stats.AutoCorr.
It must be populated manually at all other times.

Definition at line 77 of file AutoCorr.m.

◆ dfref

Property AutoCorr::dfref

dfref

A scalar object of class pm.container.DataFrame containing (a refernece to) the user-specified data whose covariance must be computed.

Definition at line 38 of file AutoCorr.m.

◆ numlag

Property AutoCorr::numlag

numlag

The positive scalar MATLAB whole number representing the number of lags for which the autocorrelation must be computed.
This argument is directly passed to the corresponding argument of the MATLAB intrinsic autocorr() in the MATLAB Econometrics Toolbox.

Definition at line 48 of file AutoCorr.m.

◆ numstd

Property AutoCorr::numstd

numstd

The positive scalar MATLAB double representing the number of standard deviations to be used in computing the lower and upper significance levels of the autocorrelation.
This argument is directly passed to the corresponding argument of the MATLAB intrinsic autocorr() in the MATLAB Econometrics Toolbox.

Definition at line 59 of file AutoCorr.m.

◆ val

Property AutoCorr::val

val

The MATLAB table of rank 2 serving as a convenient storage component for the autocorrelation.
This component is automatically populated when constructing an object of class pm.stats.AutoCorr.
It must be populated manually at all other times.

Note
The first column of val always contains the set of lags for which the autocorrelation is computed.

Definition at line 92 of file AutoCorr.m.

◆ vis

Property AutoCorr::vis

vis

The scalar MATLAB struct containing the set of predefined visualizations for the output data.

Definition at line 100 of file AutoCorr.m.


The documentation for this class was generated from the following file: