Changeset 8161a0c in tol
- Timestamp:
- Oct 21, 2008, 10:55:35 AM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 14c595e
- Parents:
- c51d000
- Location:
- tol/stdlib/math/stat/models/bayesian/bysMcmc
- Files:
-
- 2 edited
-
_inference.tol (modified) (1 diff)
-
_inference_functions.tol (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/_inference.tol
rc51d000 r8161a0c 23 23 //public API 24 24 Code get.coda.raftery.diag; 25 Code get.sample; 25 26 Code get.coda.summary; 26 Code get. sample;27 Code get.param.signif; 27 28 Code get.acf; 28 29 Code get.histogram; -
tol/stdlib/math/stat/models/bayesian/bysMcmc/_inference_functions.tol
rc51d000 r8161a0c 121 121 }; 122 122 123 124 125 ///////////////////////////////////////////////////////////////////////////// 126 Set get.acf(Text name, 127 Set colNames, 123 ///////////////////////////////////////////////////////////////////////////// 124 Set get.param.signif(Text name, 125 Set colNames, 126 BysInf.Report.Config repCfg, 127 Set sample) 128 //Builds the signification test of parameters 129 ///////////////////////////////////////////////////////////////////////////// 130 { 131 If(repCfg->acf.lag_==0, Copy(Empty), { 132 Real CMsg::Phase::show(2,"1.5 BysMcmc::Inference::get.param.signif of "+name_); 133 Real n = Card(sample); 134 Real m = Rows(sample[1]); 135 //If(n!=Card(colNames),error 136 Set test = For(1,n, Set(Real j) 137 { 138 Set test = AlgLib.OneSampleSignTest(sample[j], 0); 139 BysInf.Param.Signif 140 { 141 colNames[j], 142 Real isZero_ = test::bothtails, 143 Real isPos_ = test::lefttail, 144 Real isNeg_ = test::righttail 145 } 146 }); 147 Eval(name+".Param.Signif=test") 148 })}; 149 150 ///////////////////////////////////////////////////////////////////////////// 151 Set get.acf(Text name, 152 Set colNames, 128 153 BysInf.Report.Config repCfg, 129 Set sample)154 Set sample) 130 155 //Builds the sample autocorrelation function (ACF) of each parameter 131 156 ///////////////////////////////////////////////////////////////////////////// … … 139 164 { 140 165 Matrix mc = sample[j]; 166 //Transforming to Serie in order to use AutoCor 141 167 Serie s = MatSerSet(Tra(mc),C,Today)[1]; 142 168 Matrix acf = AutoCor(s,repCfg->acf.lag_); … … 228 254 Real m = Rows (mcmc); 229 255 Set coda.raftery.diag = get.coda.raftery.diag(name, colNames, repCfg, mcmc); 256 Set sample = get.sample(name, colNames, repCfg, mcmc); 230 257 Set coda.summary = get.coda.summary(name, colNames, repCfg, mcmc); 231 Set sample = get.sample(name, colNames, repCfg, mcmc);258 Set param.signif = get.param.signif(name, colNames, repCfg, sample); 232 259 Set acf = get.acf(name, colNames, repCfg, sample); 233 260 Set histogram = get.histogram(name, colNames, repCfg, sample); … … 239 266 repCfg, 240 267 mcmc, 268 coda.raftery.diag, 241 269 sample, 242 coda.raftery.diag,243 270 coda.summary, 271 param.signif, 244 272 acf, 245 273 histogram, … … 263 291 Do PutDescription("The CODA summary information about each individual " 264 292 "variable", 293 aux::coda.summary); 294 Do PutDescription("Test of parameter signification gives p-value of be zero, " 295 "positive or negative for each parameter", 265 296 aux::coda.summary); 266 297 Do PutDescription("Observed AutoCorrelation Function for each individual "
Note: See TracChangeset
for help on using the changeset viewer.
