ParaMonte MATLAB 3.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
SpecMCMC.m
Go to the documentation of this file.
1%> \brief
2%> This is the base class for the ParaMonte sampler MCMC specifications.<br>
3%> This is an abstract class that is not meant to be used by the user.<br>
4%> See the class constructor.<br>
5%>
6%> \note
7%> All class attributes can be set after constructing an instance of this class.<br>
8%>
9%> \note
10%> See below for information on the methods.<br>
11%>
12%> \final{SpecMCMC}
13%>
14%> \author
15%> \JoshuaOsborne, May 21 2024, 12:54 AM, University of Texas at Arlington<br>
16%> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
17%> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
18classdef SpecMCMC < pm.sampling.SpecBase
19
20 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
21
22 properties
23 outputChainSize = [];
24 outputSampleRefinementCount = [];
25 outputSampleRefinementMethod = [];
26 proposal = [];
27 proposalCor = [];
28 proposalCov = [];
29 proposalScale = [];
30 proposalStart = [];
31 proposalStartDomainCubeLimitLower = [];
32 proposalStartDomainCubeLimitUpper = [];
33 proposalStartRandomized = [];
34 proposalStd = [];
35 end
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
39 methods(Access = public)
40 %> \brief
41 %> Construct and return an object of class [pm.sampling.SpecMCMC](@ref SpecMCMC).<br>
42 %>
43 %> \param[in] method : The input scalar MATLAB string containing
44 %> the name of the specific ParaMonte sampler
45 %> whose simulation specifications are to be
46 %> stored in the output of this constructor.<br>
47 %> \param[in] silent : The input scalar MATLAB logical.<br>
48 %> If ``true``, all descriptive messages on
49 %> the MATLAB command line will be suppressed.<br>
50 %> (**optional**, default = ``false``)
51 %>
52 %> \return
53 %> The output scalar object of class [pm.sampling.SpecMCMC](@ref SpecMCMC).<br>
54 %>
55 %> \interface{SpecMCMC}
56 %> \code{.m}
57 %>
58 %> spec = pm.sampling.SpecMCMC()
59 %> spec = pm.sampling.SpecMCMC([])
60 %> spec = pm.sampling.SpecMCMC([], [])
61 %> spec = pm.sampling.SpecMCMC(method)
62 %> spec = pm.sampling.SpecMCMC(method, [])
63 %> spec = pm.sampling.SpecMCMC([], silent)
64 %> spec = pm.sampling.SpecMCMC(method, silent)
65 %>
66 %> \endcode
67 %>
68 %> \final{SpecMCMC}
69 %>
70 %> \author
71 %> \JoshuaOsborne, May 21 2024, 12:58 AM, University of Texas at Arlington<br>
72 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
73 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
74 function self = SpecMCMC(method, silent)
75 if nargin < 2
76 silent = [];
77 end
78 if nargin < 1
79 method = "ParaMCMC";
80 end
81 self = self@pm.sampling.SpecBase(method, silent);
82 end
83
84 end
85
86 methods(Hidden)
87 %> \brief
88 %> Ensure all specification properties of the parent object are sensible.<br>
89 %>
90 %> \details
91 %> This is a dynamic method of the class [pm.sampling.SpecMCMC](@ref SpecMCMC).<br>
92 %>
93 %> \param[in] self : The input parent object of class [pm.sampling.SpecMCMC](@ref SpecMCMC)
94 %> which is **implicitly** passed to this dynamic method (not by the user).<br>
95 %> \param[in] ndim : The input scalar MATLAB integer containing
96 %> the number of dimensions of the domain of the
97 %> object function that is to be explored.<br>
98 %>
99 %> \return
100 %> ``entries`` : The output scalar MATLAB string containing
101 %> the simulation specifications converted to
102 %> a Fortran-namelist-compatible entry.<br>
103 %>
104 %> \interface{getEntriesNML}
105 %> \code{.m}
106 %>
107 %> entries = self.getEntriesNML(ndim)
108 %>
109 %> \endcode
110 %>
111 %> \final{getEntriesNML}
112 %>
113 %> \author
114 %> \JoshuaOsborne, May 21 2024, 1:01 AM, University of Texas at Arlington<br>
115 %> \FatemehBagheri, May 20 2024, 1:25 PM, NASA Goddard Space Flight Center (GSFC), Washington, D.C.<br>
116 %> \AmirShahmoradi, May 16 2016, 9:03 AM, Oden Institute for Computational Engineering and Sciences (ICES), UT Austin<br>
117 function entries = getEntriesNML(self, ndim)
118 entries = getEntriesNML@pm.sampling.SpecBase(self, ndim);
119 if ~isempty(self.outputChainSize ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("outputChainSize ", self.outputChainSize , "integer" , 1); end
120 if ~isempty(self.outputSampleRefinementCount ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("outputSampleRefinementCount ", self.outputSampleRefinementCount , "integer" , 1); end
121 if ~isempty(self.outputSampleRefinementMethod ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("outputSampleRefinementMethod ", self.outputSampleRefinementMethod , "string" , 1); end
122 if ~isempty(self.proposal ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposal ", self.proposal , "string" , 1); end
123 if ~isempty(self.proposalCor ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalCor ", self.proposalCor , "real" , ndim^2); end
124 if ~isempty(self.proposalCov ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalCov ", self.proposalCov , "real" , ndim^2); end
125 if ~isempty(self.proposalScale ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalScale ", self.proposalScale , "string" , 1); end
126 if ~isempty(self.proposalStart ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalStart ", self.proposalStart , "real" , ndim); end
127 if ~isempty(self.proposalStartDomainCubeLimitLower ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalStartDomainCubeLimitLower", self.proposalStartDomainCubeLimitLower , "real" , ndim); end
128 if ~isempty(self.proposalStartDomainCubeLimitUpper ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalStartDomainCubeLimitUpper", self.proposalStartDomainCubeLimitUpper , "real" , ndim); end
129 if ~isempty(self.proposalStartRandomized ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalStartRandomized ", self.proposalStartRandomized , "logical" , 1); end
130 if ~isempty(self.proposalStd ); entries = entries + self.nmlsep + pm.introspection.getEntryNML("proposalStd ", self.proposalStd , "real" , ndim); end
131 end
132
133 end
134
135end
function name(in vendor)
Return the MPI library name as used in naming the ParaMonte MATLAB shared libraries.
This is the base class for the ParaMonte sampler basic specifications.
Definition: SpecBase.m:26
This is the base class for the ParaMonte sampler MCMC specifications. This is an abstract class that...
Definition: SpecMCMC.m:19
Property proposalStartDomainCubeLimitUpper
Definition: SpecMCMC.m:44
function SpecMCMC(in method, in silent)
Construct and return an object of class pm.sampling.SpecMCMC.
Property outputSampleRefinementCount
Definition: SpecMCMC.m:28
Property proposalCov
Definition: SpecMCMC.m:36
Property proposalStartDomainCubeLimitLower
Definition: SpecMCMC.m:42
Property proposalStd
Definition: SpecMCMC.m:48
Property outputSampleRefinementMethod
Definition: SpecMCMC.m:30
Property outputChainSize
Definition: SpecMCMC.m:26
Property proposalCor
Definition: SpecMCMC.m:34
function getEntriesNML(in self, in ndim)
Ensure all specification properties of the parent object are sensible.
Property proposalStartRandomized
Definition: SpecMCMC.m:46
Property proposalStart
Definition: SpecMCMC.m:40
Property proposalScale
Definition: SpecMCMC.m:38
Property proposal
Definition: SpecMCMC.m:32
function which(in vendor)
Return the a MATLAB string containing the path to the first mpiexec executable binary found in system...