Dear all,
I encountered the following issue: When including a dseries object into a class as a property, there appear to be issues, when attempting to manipulate the time series in the dseries object. More specifically when I try to change specific values within the dseries database, the dseries object doens’t appear to accept my changes. The corresponding values are simply not over-written. The very odd thing is, that this only happens, when I compile (a fully unrelated) dynare mod file before hand. If I don’t compile the modfile, I can manipulate the dseries object as well.
Note that this issue only if appears if
i) a class object is created BEFORE a mod file is compiled.
ii) the dseries object is a property of that class, and
iii) I access the dseries object (take dbase) in a specific manner:
classname.dbase{‘Variable’}(dates(‘somedate’) = inputdata .
To make this clearer, I added some example files which should reproduce the issue. Running ‘testAccessDbase.m’ creates two dseries databases. One is included into a class object as a property. After that a mod file is compiled. Then I attempt to change the dseries data in the object using the other dseries databases. The code then provides some instances when the insertion works and when it doesn’t. If you comment out the call to dynare any approach works. Addi-tionally, and again very oddly, if you run the m-File only until the dynare call and then proceed the remaining part of the code, the data insertions work as well.
Another observation: Getting read of the class and instead including the dseries object into a struct works quite well. So this seems specific to having the dseries object as a class property and not the result of some dot-referencing magic.
Any help on this would be appreciated. Am I missing something obvious?
Best regards
Markus
testClass.m (220 Bytes)
testmod.mod (102 Bytes)
testAccessDbase.m (811 Bytes)