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.
More...

Inheritance diagram for AutoCorr:
Collaboration diagram for AutoCorr:

Public Member Functions

function AutoCorr (in df, 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 df, in numlag, in numstd)
 Return the autocorrelation of the input data from a lag of 0 to numlag.
More...
 

Data Fields

Property numlag
 
Property numstd
 
Property bnd
 
Property lag
 
Property val
 

Detailed Description

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

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 below.
See the documentation of the class constructor 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 23 of file AutoCorr.m.

Constructor & Destructor Documentation

◆ AutoCorr()

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

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

Parameters
[in]df: The input MATLAB matrix or table of rank 2 containing the data as ncol columns of nrow observations whose autocorrelation must be computed.
(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 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 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(df)
acf = pm.stats.AutoCorr(df, numlag)
acf = pm.stats.AutoCorr(df, [], numstd)
acf = pm.stats.AutoCorr(df, numlag, numstd)
Property numstd
Definition: AutoCorr.m:48
Property numlag
Definition: AutoCorr.m:37


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, 1));')
6 acf = pm.stats.AutoCorr(unifrnd(0, 1, 1000, 1));
7pm.matlab.show('p = pm.vis.PlotLine([acf.lag, acf.val.val]); p.make("colx", 1, "coly", 2); yline(acf.bnd); yline(-acf.bnd);')
8 p = pm.vis.PlotLine([acf.lag, acf.val.val]); p.make("colx", 1, "coly", 2); yline(acf.bnd); yline(-acf.bnd);
9pm.matlab.show('p.savefig("AutoCorr.unifrnd.png", "-m3");')
10 p.savefig("AutoCorr.unifrnd.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  df,
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]df: The input MATLAB matrix or table of rank 2 containing the data as ncol columns of nrow observations whose autocorrelation must be computed.
[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(df, 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 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.
lag : The output MATLAB table of size numlag + 1 containing the autocorrelation lags from 0 to numlag.
bnd : The output MATLAB table of size(df, 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.lag, acf.bnd] = acf.get(df)
[acf.val, acf.lag, acf.bnd] = acf.get(df, [])
[acf.val, acf.lag, acf.bnd] = acf.get(df, numlag)
[acf.val, acf.lag, acf.bnd] = acf.get(df, [], numstd)
[acf.val, acf.lag, acf.bnd] = acf.get(df, 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

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 66 of file AutoCorr.m.

◆ lag

Property AutoCorr::lag

lag

The MATLAB vector integers representing the lags for which the autocorrelation is computed.
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.

◆ 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 Econometrics Toolbox.

Definition at line 37 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 Econometrics Toolbox.

Definition at line 48 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.

Definition at line 88 of file AutoCorr.m.


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