Changeset d7e2da2 in tol
- Timestamp:
- Apr 1, 2009, 3:46:50 PM (18 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 90b59de
- Parents:
- 48190fa
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tol/stdlib/math/stat/models/bayesian/bysMcmc/bsr/gibbs/_arimaBlock.tol
r48190fa rd7e2da2 518 518 "Method of generation of a ARMA block by using current scalar method," 519 519 " given by _scalarSampler, for each parameter"; 520 VMatrix draw.scalar(Real numSim, VMatrix noise, VMatrix sigma.full, 521 Real calcMaxLikelihood) 520 VMatrix draw.scalar(Real numSim, VMatrix noise, VMatrix sigma.full) 522 521 //////////////////////////////////////////////////////////////////////////// 523 522 { … … 579 578 //WriteLn("TRACE"+_MID+" draw.scalar z0="<<z0); 580 579 //WriteLn("TRACE"+_MID+" draw.scalar a0="<<a0); 581 /*582 Real maxLogLikelihood = -1/0;583 Real maxLogLikelihood.x = 0;584 */585 580 586 581 Real LogDens.Almagro.Z_cond_U(Real x) … … 590 585 Polyn ma = ARIMAGetMA(arima); 591 586 Real llh = Copy(almagro::LogLH.Z_cond_U(ar,ma,z0,a0)); 592 /*593 Real If(calcMaxLikelihood,594 If(llh>maxLogLikelihood,595 {596 Real maxLogLikelihood :=llh;597 Real maxLogLikelihood.x := x598 }));599 */600 587 llh 601 588 }; 602 589 Code LogDens = LogDens.Almagro.Z_cond_U; 603 590 Real If(Or(pd->coef<x0,pd->coef>x1), { pd->coef := Rand(x0,x1) }, 0); 604 /* 605 Real pd->coef := _scalarSampler(LogDens.Almagro.Z_cond_U,x0,x1); 606 Real If(calcMaxLikelihood, pd->coef := maxLogLikelihood.x); 607 */ 608 Real pd->coef:= If(!calcMaxLikelihood, 609 { 610 _scalarSampler(LogDens,x0,x1,pd->coef) 611 }, 612 { 613 Real MinusLogDens(Real x_) { -LogDens(x_) }; 614 Real y=0; 615 FibonacciMin(MinusLogDens, y, x0, x1, 1.E-5*n) 616 }); 591 Real pd->coef:= _scalarSampler(LogDens,x0,x1,pd->coef); 617 592 618 593 //WriteLn("TRACE"+_MID+" draw.scalar pd->coef="<<pd->coef); … … 639 614 numSim%(_.blockDef::_.config::bsr.arimaSkipIter)==0), 640 615 { 641 draw.scalar(numSim, noise, sigBlk , False)616 draw.scalar(numSim, noise, sigBlk) 642 617 }, 643 618 { 644 619 Copy(_.blockDef::_.store) 645 620 }) 646 };647 648 ////////////////////////////////////////////////////////////////////////////649 Text _.autodoc.member.maxLikelihood =650 "Method of contitioned maximum likelihood";651 VMatrix maxLikelihood(Real numSim, VMatrix noise, VMatrix sigBlk)652 ////////////////////////////////////////////////////////////////////////////653 {654 draw.scalar(numSim, noise, sigBlk, True)655 621 }; 656 622
Note: See TracChangeset
for help on using the changeset viewer.
