ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
readChainMarkov.m
Go to the documentation of this file.
1%> \brief
2%> Return a list of objects of class [pm.sampling.FileContentsChain](@ref FileContentsChain)
3%> containing the content(s) of the ParaMonte simulation output chain file(s) whose path(s)
4%> match the specified input ``pattern`` or the simulation specification
5%> [sampler.spec.outputFileName](\pmdoc_usage_sampling/paradram/specifications/#outputfilename).
6%>
7%> \param[in] self : The input/output parent object of class [pm.sampling.Paradram](@ref Paradram)
8%> which is **implicitly** passed to this dynamic method (not by the user).<br>
9%> \param[in] pattern : See the documentation of the corresponding argument of
10%> the constructor of the method [pm.sampling.Sampler.readChain](@ref Sampler::readChain).<br>
11%> (**optional**, The default is set by [pm.sampling.Sampler.readChain](@ref Sampler::readChain))
12%> \param[in] sep : See the documentation of the corresponding argument of
13%> the constructor of the method [pm.sampling.Sampler.readChain](@ref Sampler::readChain).<br>
14%> (**optional**, The default is set by [pm.sampling.Sampler.readChain](@ref Sampler::readChain))
15%>
16%> \return
17%> ``chainMarkovList`` : The output cell array of objects of class
18%> [pm.sampling.FileContentsChain](@ref FileContentsChain),
19%> each of which corresponds to the contents of a unique chain file.<br>
20%> Try ``doc pm.sampling.FileContentsChain`` to see the documentation
21%> of the contents of the objects of the output list.<br>
22%>
23%> \interface{Paradram}
24%> \code{.m}
25%>
26%> sampler = pm.sampling.Paradram();
27%> chainMarkovList = sampler.readChainMarkov();
28%> chainMarkovList = sampler.readChainMarkov([]);
29%> chainMarkovList = sampler.readChainMarkov(file);
30%> chainMarkovList = sampler.readChainMarkov([], []);
31%> chainMarkovList = sampler.readChainMarkov(file, []);
32%> chainMarkovList = sampler.readChainMarkov(file, sep);
33%>
34%> \endcode
35%>
36%> \warning
37%> Avoid using this routine for very large compact chains.<br>
38%> Reading the full Markov chain of large-scale simulation problems
39%> can be extremely memory-intensive without any potential benefits.<br>
40%>
41%> \warning
42%> This method is to be only used for post-processing of the output
43%> chain file(s) of an already finished simulation. It is NOT meant to
44%> be called by all processes in parallel mode, although it is possible.<br>
45%>
46%> \note
47%> This routine is identical to [pm.sampling.Sampler.readChain](@ref Sampler::readChain)
48%> method, except for the fact that upon reading the output chain files, it will also
49%> convert the chain contents from the default efficient compact format stored
50%> in the file to the full verbose Markov chain format.<br>
51%>
52%> \example{readChainMarkov}
53%> \include{lineno} example/sampling/Paradram/readChainMarkov/main.m
54%> \include{lineno} example/sampling/Paradram/readChainMarkov/main.out.m
55%> \vis{readChainMarkov}
56%> \image html example/sampling/Paradram/readChainMarkov/readChainMarkov.domain.png width=700
57%> \image html example/sampling/Paradram/readChainMarkov/readChainMarkov.traceplot.png width=700
58%> \image html example/sampling/Paradram/readChainMarkov/readChainMarkov.proposalAdaptation.png width=700
59%>
60%> \final{readChainMarkov}
61%>
62%> \author
63%> \JoshuaOsborne, May 21 2024, 12:06 AM, University of Texas at Arlington<br>
64%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
65function chainMarkovList = readChainMarkov(self, pattern, sep)
66 if nargin < 3
67 sep = [];
68 end
69 if nargin < 2
70 pattern = [];
71 end
72 chainMarkovList = self.readChain(pattern, sep);
73 for ichain = 1 : length(chainMarkovList)
74 chainMarkovList{ichain}.df = pm.array.verbose(chainMarkovList{ichain}.df, 1, chainMarkovList{ichain}.df.sampleWeight);
75 chainMarkovList{ichain}.df.sampleWeight(:) = 1;
76 end
77end
function list()
Return a list of MATLAB strings containing the names of OS platforms supported by the ParaMonte MATLA...
This is the base class for generating objects that contain the contents of a chain file generated by ...
This is the ParaDRAM class for generating instances of serial and parallel Delayed-Rejection Adaptive...
Definition: Paradram.m:14
function Paradram()
Generate and return an instance of the serial and parallel Delayed-Rejection Adaptive Metropolis-Hast...
function readChain(in self, in pattern, in sep)
Return a list of objects of class pm.sampling.FileContentsChain containing the content(s) of the Para...
function parallel()
Return a scalar MATLAB logical that is true if and only if the current installation of MATLAB contain...
function verbose(in cmat, in dim, in weight)
Return a MATLAB double, cell, or table matrix whose rows or columns are unrolled according to a presp...
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...