Changeset 9421997 in tol
- Timestamp:
- May 13, 2010, 2:57:16 PM (16 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- db2b6d3
- Parents:
- 14855c0
- File:
-
- 1 edited
-
tol_pkg/BysVecLinReg/Multivariate.tol (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tol_pkg/BysVecLinReg/Multivariate.tol
r14855c0 r9421997 117 117 118 118 //////////////////////////////////////////////////////////////////////////// 119 // Returns G( A)119 // Returns G(coefMat) 120 120 // User must inherite a class redefining this method to apply 121 121 // arbitrary constraining inequalities and set the correct value of _.r.G 122 VMatrix eval.arbitraryConstrainingInequalities(VMatrix A)122 VMatrix eval.arbitraryConstrainingInequalities(VMatrix coefMat) 123 123 //////////////////////////////////////////////////////////////////////////// 124 124 { … … 370 370 Real _numTry = 0; 371 371 VMatrix A = BysVecLinReg::vec2vmatrix(vec.A,_.A); 372 VMatrix G.A = Rand(0,0,0,0); 373 Real min.G.A = ?; 372 374 While(And(!match,_numTry<maxAcceptRejectTry), 373 375 { 374 376 //WriteLn("TRACE gibbs.draw.vec.A 3"); 375 VMatrix G.A = eval.arbitraryConstrainingInequalities(A); 376 Real match := VMatMin(G.A)>=0; 377 VMatrix G.A := eval.arbitraryConstrainingInequalities(A); 378 Real min.G.A := VMatMin(G.A); 379 Real match := Copy(min.G.A>0); 377 380 VMatrix If(!match, 378 381 { … … 384 387 If(match, 385 388 { 386 VMatrix _.vec.A := vec.A; 387 VMatrix _.A := A; 389 //WriteLn("TRACE [BysVecLinReg::@Multivariate::gibbs.draw.vec.A] accepted simulation "<<numSim+" with min.G.A = "<<min.G.A+" after "<<_numTry+" tries "); 390 //WriteLn("TRACE [BysVecLinReg::@Multivariate::gibbs.draw.vec.A] vec.A=\n"<<VMat2Mat(vec.A)); 391 VMatrix _.vec.A := Copy(vec.A); 392 VMatrix _.A := Copy(A); 388 393 Copy(_.vec.A) 389 394 }, … … 391 396 WriteLn("[BysVecLinReg::@Multivariate::gibbs.draw.vec.A] Too much " 392 397 "rejected tries at simulation "<<numSim, "W"); 393 Copy( _.vec.A)398 Copy(vec.A) 394 399 }) 395 400 })
Note: See TracChangeset
for help on using the changeset viewer.
