Hi Houtan,
For me this is not a bug, but we may want to change this behaviour. In your example, isequal returns 0 because of the NaNs in ts3 and ts4: a NaN is not equal to a NaN. We may instead compare only the non NaN elements of the dseries objects...
Best, Stéphane.
Houtan Bastani houtanb@gmail.com writes:
The isequal statement should evaluate to true but doesn’t….
ts1=dseries([1;2;3], '1999y', {'MyVar1'}, {'MyVar_1'}); ts2=dseries([4;5;6], '2000y', {'MyVar2'}, {'MyVar_2'}); ts3=[ts1 ts2] ts4=ts1.insert(ts2,2) isequal(ts3,ts4)
alternatively you could use isequalwithnans instead of just isequal.
J.
On Tue, May 13, 2014 at 5:43 PM, Stéphane Adjemian < stephane.adjemian@univ-lemans.fr> wrote:
Hi Houtan,
For me this is not a bug, but we may want to change this behaviour. In your example, isequal returns 0 because of the NaNs in ts3 and ts4: a NaN is not equal to a NaN. We may instead compare only the non NaN elements of the dseries objects...
Best, Stéphane.
Houtan Bastani houtanb@gmail.com writes:
The isequal statement should evaluate to true but doesn’t….
ts1=dseries([1;2;3], '1999y', {'MyVar1'}, {'MyVar_1'}); ts2=dseries([4;5;6], '2000y', {'MyVar2'}, {'MyVar_2'}); ts3=[ts1 ts2] ts4=ts1.insert(ts2,2) isequal(ts3,ts4)
-- Stéphane Adjemian https://stepan.ithaca.fr Université du Maine, Gains and DynareTeam
Dev mailing list Dev@dynare.org https://www.dynare.org/cgi-bin/mailman/listinfo/dev