.. _quickstart: Quick Start ============ BayCal is a RAVEN plugin, it utilizes RAVEN input structure to design the workflow calculation, and contains the following XML blocks. Root XML block: +++++++++++++++++++++++++++++++++++++ .. code:: xml ... Prior distribution block: +++++++++++++++++++++++++++++++++++++++ Many distributions can be defined through the XML block, such as Beta, Exponential, Gamma, Lapace, Logistic, LogNormal, LogUniform, Normal, Triangular, Uniform, Weibull, or custom defined distributions. For example: .. code:: xml 0 10 0 1 Bayesian inference via Markov Chain Monte Carlo +++++++++++++++++++++++++++++++++++++++++++++++++ Both Metropolis method and AdaptiveMetropolis method can be used to perform Bayesian inference. The posterior distribution can be computed through these methods. .. code:: xml 1000 070419 500 likelihood normal 0 propDist normal 0 propDist outSet Likelihood Model ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ A BayCal likelihood model can be defined, both simulation output and experimental data are integrated into the likelihood model to compute the posterior distribution. For example, An ExternalModel "simple" is used to represent the simulation model, while an ExternalModel "likelihood" is used to integrate simulation output and experimental data. An EnsembleModel is used to couple simulation model with BayCal LikelihoodModel. .. code:: xml likelihood, zout zout 2.11500008, 0.14946724, -1.65039824, 4.35404944, 2.81822947, 6.54820123, -1.75704173, 2.25129699, -1.19830637, 3.76461502, 0.386274 , 0.3026495 , 1.6467714 , -0.18838893, -0.40815504, 2.11830326, 2.08114549, 2.4998607 , 2.79584898, 3.88973006, -2.7575892 , -0.04385282, 0.05381042, -1.46692956, 1.70190605, -1.57171388, 4.11788556, -1.63605661, 3.80630774, 2.84303567, -1.38054778, -1.21978835, -0.22892141, 4.32828596, 1.43980194, 3.2975833 , 2.50307962, 3.99509689, -0.04558891, -2.93355096, 1.54869592, 0.82694381, -2.27505536, 2.10192782, -0.02294763, 1.36074938, -0.69042317, 1.80091876, 0.03907101, -2.38166576, 1.563129 , 1.20795836, 2.29019786, 2.65269473, 0.85751374, -0.59481231, 1.80102222, 0.02886628, 6.45080851, 4.07795272, 7.16290259, 1.35855176, -0.75228632, 1.65880613, 2.4717668 , 1.10216817, -0.44061435, -1.92342245, 3.05321389, 0.89013387, -1.05614164, 0.33685368, 1.65889606, -0.49594808, 6.63155206, 3.70915947, -0.46757349, 0.75459259, -0.87910652, 2.84513982, -2.27714018, 2.16478883, -0.31847088, 5.61444774, -1.28556545, 2.6697912 , 0.84654927, 8.2436798 , 1.80816732, 3.72230814, 3.36955247, 0.72882023, -3.85778293, -1.2840472 , 1.65360275, -0.48916641, 2.25437166, 1.28519366, -3.07200649, 1.02090558 pca 0 alpha, beta, zout simple inputHolderSimple simData likelihood inputHolderLikelihood lhData DataObjects as internal data container +++++++++++++++++++++++++++++++++++++++++++++++++++++++ DataObjects are required to store the inputs/outputs. .. code:: xml zout OutputPlaceHolder alpha, beta, zout OutputPlaceHolder alpha, beta OutputPlaceHolder alpha, beta zout, likelihood traceID alpha, beta alpha, beta zout zout likelihood OutStreams can be used to save the calculations into CSV files ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code:: xml csv outSet input, output csv out_export input, output Steps to control the calculation flows: +++++++++++++++++++++++++++++++++++++++ MultiRun is used to perform the Metropolis/AdaptiveMetropolis sampling. IOStep is used to manage the inputs/outputs streams. .. code:: xml inputHolderLikelihood inputHolderSimple EnsembleLH Metropolis out_export simData lhData outSet out_export outSet dumpExport dumpOut RunInfo to define the global settings for the calculations +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ .. code:: xml external BayesianInference, print 1 False