#444 closed defect (fixed)
Problems with MatSerSet
Reported by: | César Pérez Álvarez | Owned by: | Víctor de Buen Remiro |
---|---|---|---|
Priority: | highest | Milestone: | |
Component: | SetAlgebra | Version: | head |
Severity: | blocker | Keywords: | |
Cc: |
Description
If we run this code:
Serie EstimCensoredData
(
Serie ser,
Serie top,
Serie filter,
Real sigma
)
{
Serie indCensoredData = EQ(ser, top);
Date first = FirstNotEqual(ser, First(ser), 0);
TimeSet auto = SerTms(indCensoredData);
Serie filterAuto = DatCh(filter, auto, FirstS);
Serie filterAutoSub = SubSer(filterAuto, first, Last(filterAuto));
Serie topAuto = DatCh(top, auto, FirstS);
Serie topAutoSub = SubSer(topAuto, first, Last(filterAuto));
Matrix mFilterAuto = Tra(SerMat(filterAutoSub));
Matrix mTopAuto = Tra(SerMat(topAutoSub));
Real n = Rows(mFilterAuto);
Matrix lCovBeta = Diag(n, sigma);
Matrix limInf = mTopAuto;
Matrix limSup = Rand(n, 1, TheMaxAbsValue, TheMaxAbsValue);
Matrix censored =
RandTruncatedMultNormal(mFilterAuto, lCovBeta, limInf, limSup, 1, 1);
Set setCensored = MatSerSet(Tra(censored), auto, first);
IfSer(indCensoredData, InvCh(setCensored[1], CalInd(W, Diario)), ser)
};
FUNCTIONS
Serie top = 199*CalInd(C,Diario);
Serie serAux = SubSer(top-Gaussian(10, 10, Diario), y2004m01d01, y2006m02d01);
Serie ser = IfSer(GT(top, serAux), serAux,top);
Serie filter = AvrS(ser)*CalInd(C,Diario);
Real sigma = StDsS(serAux);
Serie final = EstimCensoredData(ser, top, filter,sigma);
And now if we try to tabulate the final time series then TOL crashes.
However in this code the things run correctly:
Serie top = 199*CalInd(C,Diario);
Serie serAux = SubSer(top-Gaussian(10, 10, Diario), y2004m01d01, y2006m02d01);
Serie ser = IfSer(GT(top, serAux), serAux,top);
Serie filter = AvrS(ser)*CalInd(C,Diario);
Real sigma = StDsS(serAux);
Serie indCensoredData = EQ(ser, top);
Date first = FirstNotEqual(ser, First(ser), 0);
TimeSet auto = SerTms(indCensoredData);
Serie filterAuto = DatCh(filter, auto, FirstS);
Serie filterAutoSub = SubSer(filterAuto, first, Last(filterAuto));
Serie topAuto = DatCh(top, auto, FirstS);
Serie topAutoSub = SubSer(topAuto, first, Last(filterAuto));
Matrix mFilterAuto = Tra(SerMat(filterAutoSub));
Matrix mTopAuto = Tra(SerMat(topAutoSub));
Real n = Rows(mFilterAuto);
Matrix lCovBeta = Diag(n, sigma);
Matrix limInf = mTopAuto;
Matrix limSup = Rand(n, 1, TheMaxAbsValue, TheMaxAbsValue);
Matrix censored =
RandTruncatedMultNormal(mFilterAuto, lCovBeta, limInf, limSup, 1, 1);
Set setCensored = MatSerSet(Tra(censored), auto, first);
Serie final = IfSer(indCensoredData, InvCh(setCensored[1], CalInd(W, Diario)), ser)
Another last thing: if we return a Set function instead of a Serie function putting a MatSerSet and we tabulate the series inside the things go right.
Change History (3)
comment:1 Changed 18 years ago by
Owner: | changed from danirus to Víctor de Buen Remiro |
---|
comment:2 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Bug has been fixed in CVS a few days ago
A new test tol_tests/tol/Bugzilla/bug_000444 has been added
comment:3 Changed 18 years ago by
bug_file_loc: | → http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000444 |
---|
We are working about thid bug
Thanks to report it