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

This is the base class for generating objects that contain the contents of a restart file generated by a ParaMonte sampler.
More...

Inheritance diagram for FileContentsRestartDRAM:
Collaboration diagram for FileContentsRestartDRAM:

Public Member Functions

function FileContentsRestartDRAM (in file, in silent)
 Return a scalar object of class pm.sampling.FileContentsRestartDRAM.
More...
 
function warn (in self)
 

Data Fields

Property meanAcceptanceRateSinceStart
 
Property proposalAdaptiveScaleSq
 
Property proposalCor
 
Property proposalCov
 
Property proposalCovLogVol
 
Property proposalMean
 
Property uniqueStateVisitCount
 
Property vis
 

Detailed Description

This is the base class for generating objects that contain the contents of a restart file generated by a ParaMonte sampler.

This class is meant to be primarily internally used by the ParaMonte MATLAB library samplers.

Warning
The attributes of this class are considered internal implementation of the ParaMonte library.
As such, the interface of this class may change over time.

See the documentation of the class constructor.

Note
See below for information on the attributes (properties).
See below for information on the methods.


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, 3:26 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 30 of file FileContentsRestartDRAM.m.

Constructor & Destructor Documentation

◆ FileContentsRestartDRAM()

function FileContentsRestartDRAM::FileContentsRestartDRAM ( in  file,
in  silent 
)

Return a scalar object of class pm.sampling.FileContentsRestartDRAM.

This is the constructor of the class pm.sampling.FileContentsRestartDRAM.

Parameters
[in]file: The input scalar MATLAB string containing the path to an external report file.
[in]silent: See the corresponding argument of pm.sampling.FileContentsRestart class.
(optional. The default is set by pm.sampling.FileContentsRestart.)
Returns
self : The output scalar object of class pm.sampling.FileContentsRestartDRAM.


Possible calling interfaces

contents = pm.sampling.FileContentsRestartDRAM(file)
contents = pm.sampling.FileContentsRestartDRAM(file, [])
contents = pm.sampling.FileContentsRestartDRAM(file, silent)
contents = pm.sampling.FileContentsRestartDRAM(file, [], [])
contents = pm.sampling.FileContentsRestartDRAM(file, silent, [])
contents = pm.sampling.FileContentsRestartDRAM(file, silent, method)


Example usage

1close all
2clear all
3cd(fileparts(mfilename('fullpath'))); % Change working directory to source code directory.
4addpath('../../../'); % Add the ParaMonte library root directory to the search path.
5
6%%%%
7%%%% Setup the sampler.
8%%%%
9
10sampler = pm.sampling.Paradram();
11sampler.spec.outputStatus = "retry";
12sampler.spec.proposalStart = [-5, 5];
13sampler.spec.outputFileName = "himmelblau";
14sampler.spec.randomSeed = 28457353; % make sampling reproducible.
15sampler.spec.outputRestartFileFormat = "ascii";
16
17%%%%
18%%%% Run the sampler.
19%%%%
20
21sampler.run ( @(x) pm.stats.dist.himmelblau.getLogUDF(x(1), x(2)) ...
22 , 2 ... ndim
23 );
24
25%%%%
26%%%% Postprocess the output restart file.
27%%%%
28
29restart = sampler.readRestart();
30restart = restart{1};
31
32disp("class(restart)");
33disp( class(restart) );
34
35for vistype = ["line"]
36 restart.vis.cascade.(vistype).make();
37 restart.vis.cascade.(vistype).savefig ( "FileContentsRestartDRAM." ...
38 + restart.vis.cascade.(vistype).template.subplot.coly ...
39 + "." + vistype + ".png" ...
40 , "-m3");
41end
42
43for field = ["proposalCor", "proposalCov"]
44 for vistype = ["ellipse", "ellipse3"]
45 restart.vis.(field).cascade.(vistype).make();
46 restart.vis.(field).cascade.(vistype).savefig ( "FileContentsRestartDRAM." + field + "." + vistype + "." ...
47 + string(restart.vis.(field).cascade.ellipse3.template.subplot.dimx) ...
48 + string(restart.vis.(field).cascade.ellipse3.template.subplot.dimy) ...
49 + ".png" ...
50 , "-m3" ...
51 );
52 end
53end
function root()
Return a scalar MATLAB string containing the root directory of the ParaMonte library package.
function savefig(in varargin)
Export figures in a publication-quality format.

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, 3:31 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

◆ warn()

function FileContentsRestartDRAM::warn ( in  self)

Field Documentation

◆ meanAcceptanceRateSinceStart

Property FileContentsRestartDRAM::meanAcceptanceRateSinceStart

meanAcceptanceRateSinceStart

The real-valued MATLAB array of rank 1 of shape (1:self.count) containing the set of average MCMC acceptance rates of the sampler proposal distribution over the course of the simulation.

Definition at line 46 of file FileContentsRestartDRAM.m.

◆ proposalAdaptiveScaleSq

Property FileContentsRestartDRAM::proposalAdaptiveScaleSq

proposalAdaptiveScaleSq

The real-valued MATLAB array of rank 1 of shape (1:self.count) containing the set of adaptive squared scale factors of the sampler proposal distribution over the course of the simulation.

Definition at line 56 of file FileContentsRestartDRAM.m.

◆ proposalCor

Property FileContentsRestartDRAM::proposalCor

proposalCor

The real-valued MATLAB array of rank 3 of shape (self.ndim, self.ndim, self.count) containing the set of correlation matrices of the proposal distribution of the sampler, representing the evolution of the proposal correlation matrix over the course of the simulation.

Definition at line 67 of file FileContentsRestartDRAM.m.

◆ proposalCov

Property FileContentsRestartDRAM::proposalCov

proposalCov

The real-valued MATLAB array of rank 3 of shape (1:self.ndim, 1:self.ndim, 1:self.count) containing the set of covariance matrices of the proposal distribution of the sampler, representing the evolution of the proposal covariance matrix over the course of the simulation.

Definition at line 78 of file FileContentsRestartDRAM.m.

◆ proposalCovLogVol

Property FileContentsRestartDRAM::proposalCovLogVol

proposalCovLogVol

The real-valued MATLAB array of rank 1 of shape (1:self.count) containing the set of log(determinant(covmat)) of the proposal distribution representing the evolution of mean of proposal distribution over the course of the simulation.

Definition at line 89 of file FileContentsRestartDRAM.m.

◆ proposalMean

Property FileContentsRestartDRAM::proposalMean

proposalMean

The real-valued MATLAB array of rank 2 of shape (1:self.ndim, 1:self.count) containing the set of mean vectors of the proposal distribution of the sampler, representing the evolution of the proposal mean over the course of the simulation.

Definition at line 100 of file FileContentsRestartDRAM.m.

◆ uniqueStateVisitCount

Property FileContentsRestartDRAM::uniqueStateVisitCount

uniqueStateVisitCount

The scalar MATLAB integer containing the number of states uniquely visited within the domain of the objective function up to the stage specified within the specified restart file.

Definition at line 110 of file FileContentsRestartDRAM.m.

◆ vis

Property FileContentsRestartDRAM::vis

vis

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

Definition at line 118 of file FileContentsRestartDRAM.m.


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