close Warning: Can't synchronize with repository "(default)" (/var/svn/tolp does not appear to be a Subversion repository.). Look in the Trac log for more information.

Opened 21 years ago

Closed 21 years ago

Last modified 18 years ago

#150 closed defect (fixed)

Problem with AutoCor functions

Reported by: César Pérez Álvarez Owned by: danirus
Priority: high Milestone:
Component: Math Version: head
Severity: major Keywords:
Cc:

Description

If we execute the following code we have a problem in AutoCor function

Serie calInd = CalInd(WD(4), Diario);
Observe that the first serie has two zeros less than the second one
Serie calNormal = SubSer(calInd, y2002m01d03, y2003m01d01);
Serie calZero = SubSer(calInd, y2002m01d01, y2003m01d01);

All is OK: cork = covk/cov0
Matrix covNormal = AutoCov(calNormal,40);
Matrix corNormal = AutoCor(calNormal,40);

There is a problem: cork =! covk/cov0
The problem is that corZero = corNormal (I think that the number of data to
calculate estimated covarianzes in both cases is the same, when we have two
zeros more in the second case than the first one)
Matrix covZero = AutoCov(calZero,40);
Matrix corZero = AutoCor(calZero,40);

Change History (3)

comment:1 Changed 21 years ago by danirus

Status: newassigned

comment:2 Changed 21 years ago by danirus

Resolution: fixed
Status: assignedclosed

This bug has just been resolved.

A filtering operation occurs in AutoCor function (stat.cpp).

During that filtering, all "Unknown" and "0" values from the beginning and before
the first "not null" and "not Unknown" value was erased from the array used to
make the computation. The same erase operation also was done starting at the
end of the BArray.

I think that filtering operation should be done only with Unkown values.

comment:3 Changed 18 years ago by Víctor de Buen Remiro

bug_file_loc: http://cvs.tol-project.org/viewcvs.cgi/tol_tests/tol/Bugzilla/bug_000150
Note: See TracTickets for help on using tickets.