dseries issueshttps://git.dynare.org/Dynare/dseries/-/issues2023-08-30T12:13:31Zhttps://git.dynare.org/Dynare/dseries/-/issues/57Filter out data series with NaN passed to x132023-08-30T12:13:31ZJohannes PfeiferFilter out data series with NaN passed to x13`x13` does not handle missing values. The `print`-method already removes leading and trailing `NaN`. But we do not check for intermediate `NaN`, which will trigger `x13` to fail. It would be preferable to return a meaningful message in t...`x13` does not handle missing values. The `print`-method already removes leading and trailing `NaN`. But we do not check for intermediate `NaN`, which will trigger `x13` to fail. It would be preferable to return a meaningful message in this case.https://git.dynare.org/Dynare/dseries/-/issues/56Fix handling of leading missing values in x132023-08-31T09:36:42ZJohannes PfeiferFix handling of leading missing values in x13The x13 `print` method discards leading NaN in the data:
```
p1 = firstobservedperiod(o.y);
p2 = lastobservedperiod(o.y);
...
fprintf(fid, ' data = %s', sprintf(data2txt(o.y(p1:p2).data)));
```
However, the `run`-method passes the result...The x13 `print` method discards leading NaN in the data:
```
p1 = firstobservedperiod(o.y);
p2 = lastobservedperiod(o.y);
...
fprintf(fid, ' data = %s', sprintf(data2txt(o.y(p1:p2).data)));
```
However, the `run`-method passes the results back as a `dseries` starting with the first `NaN`-period `o.y.init` instead of `o.y.firstobservedperiod`:
```
o.results.(savedoutput{i}) = dseries(data(:,2), o.y.init, savedoutput{i});
```
It seems all occurrences of `o.y.init` in `run` should be `o.y.firstobservedperiod`https://git.dynare.org/Dynare/dseries/-/issues/54Add method for cleaning up after x11 run2023-05-27T12:46:33ZJohannes PfeiferAdd method for cleaning up after x11 runRuns of x11 will create various files with random names and endings like `d10,err,log,out,spc` in the main folder. We should add a routine that allows cleaning it.Runs of x11 will create various files with random names and endings like `d10,err,log,out,spc` in the main folder. We should add a routine that allows cleaning it.6.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/53Fix crash after using insert2023-05-12T16:06:53ZJohannes PfeiferFix crash after using insertSee https://forum.dynare.org/t/dseries-insert-doesnt-carry-the-new-index/22386/5
```
clear all
load acetylene.mat
ds_example = dseries(y)
size(ds_example)
ds_nan = dseries(NaN, ds_example.dates, "inserted_Variable")
ds_example1 = insert(...See https://forum.dynare.org/t/dseries-insert-doesnt-carry-the-new-index/22386/5
```
clear all
load acetylene.mat
ds_example = dseries(y)
size(ds_example)
ds_nan = dseries(NaN, ds_example.dates, "inserted_Variable")
ds_example1 = insert(ds_example, ds_nan{1}, 1) % we succesfully insert a variable
size(ds_example1) % check what we’ve done
ds_example1{1} % works
ds_example1{end} % doesn’t work (ds_example1{2} and ds_example1{‘Variable_1’} don’t work either)
```
crashes with
> Index exceeds the number of array elements. Index must not exceed 1.
>
> Error in indexing (line 305)
> r.ops = o.ops(idx);
, presumably due to a problem with populating the command history.https://git.dynare.org/Dynare/dseries/-/issues/47bug in double for dates at yearly frequency2021-05-13T14:15:31ZMarco Rattobug in double for dates at yearly frequencyfor a dates object
```
dd=dates('2001Y');
```
the double of it provides `2000`
```
dd.double
ans =
2000
```for a dates object
```
dd=dates('2001Y');
```
the double of it provides `2000`
```
dd.double
ans =
2000
```5.xSébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dseries/-/issues/45Compatibility issue with MATLAB R2014a2021-01-27T17:30:42ZSébastien VillemotCompatibility issue with MATLAB R2014aIf one runs:
```
x = dseries(ones(2,2),'1Y',{'A1'; 'A2'});
y = { 'A1', 'A2'};
x{y{:}}.data(2:end, :)
```
The result is correct under MATLAB R2020b:
```
ans =
1 1
```
But it is incorrect under MATLAB R2014a:
```
ans =
1
`...If one runs:
```
x = dseries(ones(2,2),'1Y',{'A1'; 'A2'});
y = { 'A1', 'A2'};
x{y{:}}.data(2:end, :)
```
The result is correct under MATLAB R2020b:
```
ans =
1 1
```
But it is incorrect under MATLAB R2014a:
```
ans =
1
```
Note that this is not a purely theoretical problem. It causes the failure of `tests/smoother2histval/fs2000_simul.mod` under R2014a.5.xStéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/44Integration with DBnomics2020-06-25T09:43:31ZSébastien VillemotIntegration with DBnomicsAllow the construction of series using identifiers or other criteria.
Inspiration could be taken from the API of the [rdbnomics package](https://github.com/dbnomics/rdbnomics).Allow the construction of series using identifiers or other criteria.
Inspiration could be taken from the API of the [rdbnomics package](https://github.com/dbnomics/rdbnomics).https://git.dynare.org/Dynare/dseries/-/issues/43columns() function is missing in dseries2020-03-02T08:52:07ZMichelJuillardcolumns() function is missing in dseriesWhen one attempts to use ``dseries`` standalone without Dynare, one gets the following error:
```
To use 'columns', the following product must be licensed, installed, and enabled:
Database Toolbox
Error in dseries/vobs (line 28)
s = c...When one attempts to use ``dseries`` standalone without Dynare, one gets the following error:
```
To use 'columns', the following product must be licensed, installed, and enabled:
Database Toolbox
Error in dseries/vobs (line 28)
s = columns(o.data);
Error in dseries/display (line 34)
if ~vobs(o)
```
because the columns() function is offered by Dynare in ``missing/rows_columns/columns.m``Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/41Logic for detection of bitwidth (32 or 64) for x13as binary is incorrect2019-10-03T14:59:33ZSébastien VillemotLogic for detection of bitwidth (32 or 64) for x13as binary is incorrectThe function `src/utilities/is/is64bit.m` is used to decide whether we use a 32-bit or 64-bit binary of x13as.
The logic of this test is doubly wrong.
First, it claims to check whether MATLAB or Octave is 32-bit or 64-bit, but it does ...The function `src/utilities/is/is64bit.m` is used to decide whether we use a 32-bit or 64-bit binary of x13as.
The logic of this test is doubly wrong.
First, it claims to check whether MATLAB or Octave is 32-bit or 64-bit, but it does it by checking the maximum size of matrix indices (there are 64-bit version of Octave which have a 32-bit index).
But, fundamentally, testing the bitwidth of MATLAB/Octave is not what we want, since x13as is an independent executable. We should rather test whether the operating system is 32- or 64-bit, as is currently done for the preprocessor binary.https://git.dynare.org/Dynare/dseries/-/issues/40Incompatibility with MATLAB < R2013b and with Octave2018-12-10T22:42:30ZSébastien VillemotIncompatibility with MATLAB < R2013b and with OctaveThe file `src/@dseries/dseries.m` contains a call to `istable`, which was introduced in MATLAB R2013b (and which does not exist under Octave).The file `src/@dseries/dseries.m` contains a call to `istable`, which was introduced in MATLAB R2013b (and which does not exist under Octave).https://git.dynare.org/Dynare/dseries/-/issues/39Fix x13 on Octave2018-12-12T13:48:11ZStéphane Adjemianstepan@adjemian.euFix x13 on OctaveThree unit tests are failing because when reading the files produced by the X13 binary. The problem seems to be that the behaviour of `importdata` is different under Octave and Matlab.Three unit tests are failing because when reading the files produced by the X13 binary. The problem seems to be that the behaviour of `importdata` is different under Octave and Matlab.Sébastien VillemotSébastien Villemothttps://git.dynare.org/Dynare/dseries/-/issues/38Inconsistency in similary actions2018-12-10T23:02:36ZHoutan BastaniInconsistency in similary actionsOriginally reported in #37
The problem code is the following. The first block works without problem, the second fails.
```
zero = dseries(zeros(8,1), '2011q1');
% Modifying all of b (this works)
a = dseries((1:8)', '2011q1');
b...Originally reported in #37
The problem code is the following. The first block works without problem, the second fails.
```
zero = dseries(zeros(8,1), '2011q1');
% Modifying all of b (this works)
a = dseries((1:8)', '2011q1');
b = a;
b = b + 1;
assert(~all(a - b == zero));
% Modifying only part of b (this does not work as it modifies a as well)
a = dseries((1:8)', '2011q1');
b = a;
b(dates('2012q2'):dates('2012q4')) = b(dates('2012q2'):dates('2012q4')) + 1;
assert(~all(a - b == zero), 'a and b should not be equal here');
```
This is a problem because seemingly similar code works inconsistently without the user's knowledge.
I understand there are no good solutions to this: either slow down the code by making copies everywhere, thus returning it to the old, structure-style class setup that Matlab had, or accept to have this bug. We may have to choose an un-ideal option here.....
Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/37Modifying dseries does not work as expected2018-09-21T04:38:15ZHoutan BastaniModifying dseries does not work as expected```
zero = dseries(zeros(8,1), '2011q1');
% Modifying all of b (this works)
a = dseries((1:8)', '2011q1');
b = a;
b = b + 1;
assert(~all(a - b == zero));
% Modifying only part of b (this does not work as it modifies a as well)...```
zero = dseries(zeros(8,1), '2011q1');
% Modifying all of b (this works)
a = dseries((1:8)', '2011q1');
b = a;
b = b + 1;
assert(~all(a - b == zero));
% Modifying only part of b (this does not work as it modifies a as well)
a = dseries((1:8)', '2011q1');
b = a;
b(dates('2012q2'):dates('2012q4')) = b(dates('2012q2'):dates('2012q4')) + 1;
assert(~all(a - b == zero), 'a and b should not be equal here');
```Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/36bug in concatenation of dseries with non-overlapping dates2018-09-21T04:38:15ZHoutan Bastanibug in concatenation of dseries with non-overlapping datesTo reproduce the error, run the following:
```
a=dseries(rand(10,1), '1999q2','var1');
b=dseries(rand(10,1), '1999q1', 'var2');
c=[a b];
b
```
Here, `c` is correct, but typing `a` or `b` after the concatenation results in the erro...To reproduce the error, run the following:
```
a=dseries(rand(10,1), '1999q2','var1');
b=dseries(rand(10,1), '1999q1', 'var2');
c=[a b];
b
```
Here, `c` is correct, but typing `a` or `b` after the concatenation results in the error:
```
Error using dates/subsref (line 162)
dates::subsref: indices has to be a vector of positive integers less than or equal to 10!
Error in dseries/display (line 46)
TABLE = char(TABLE, date2string(o.dates(t)));
```Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/35do not support the length operator on a dseries2018-09-21T04:38:15ZHoutan Bastanido not support the length operator on a dseriesThe original problem encounered was the following
```
ds = dseries();
isempty(ds) && length(ds) == 1
```
This is unexpected in Matlab, given that empty cells and arrays have length equal to `0`:
```
isempty({}) && length({}) == 0
...The original problem encounered was the following
```
ds = dseries();
isempty(ds) && length(ds) == 1
```
This is unexpected in Matlab, given that empty cells and arrays have length equal to `0`:
```
isempty({}) && length({}) == 0
```
and
```
isempty([]) && length([]) == 0
```
But then I realized `length` was not supported at all. However, thinking about it a bit more, `length` seems confusing when applied to `dseries`, hence I think it should return an error instructing the user to use `nobs` or `vobs` instead.
https://git.dynare.org/Dynare/dseries/-/issues/25Add wild card to dseries2018-09-21T04:38:15ZHoutan BastaniAdd wild card to dseriesGiven a dseries
```
a = dseries(rand(3,3),'1999y',{'GDP_US','GDP_FR','CPI_US'})
```
it would be useful to be able to pick out all `dseries` for a given country. Hence, something like
```
a{'@*@_US'}
```
should return
```
ans is...Given a dseries
```
a = dseries(rand(3,3),'1999y',{'GDP_US','GDP_FR','CPI_US'})
```
it would be useful to be able to pick out all `dseries` for a given country. Hence, something like
```
a{'@*@_US'}
```
should return
```
ans is a dseries object:
| GDP_US | CPI_US
1999Y | 0.95717 | 0.79221
2000Y | 0.48538 | 0.95949
2001Y | 0.80028 | 0.65574
```
This would be easier to type than `a{'@GDP,CPI@_US'}` and useful in larger `dseries`Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/24bug in @ syntax2018-09-21T04:38:15ZHoutan Bastanibug in @ syntax```
a = dseries(rand(3,3))
a{'Variable_@1,2@'}
a{'Variable_@2@'}
```
The second line works but the third line fails. There is no reason for the third line to fail. One can imagine a user wanting to access multiple dseries but, in do...```
a = dseries(rand(3,3))
a{'Variable_@1,2@'}
a{'Variable_@2@'}
```
The second line works but the third line fails. There is no reason for the third line to fail. One can imagine a user wanting to access multiple dseries but, in doing so, wanting to see one dseries as s/he is working.Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/23potentially add new syntax2018-09-21T04:38:15ZHoutan Bastanipotentially add new syntaxImagine a `dseries` declared as:
```
s = dseries(rand(3,6), 1, {'a1','a2','b1','b2','c1','c2'});
```
Currently, we can select all series that end with a `2` by typing:
```
s{'@a,b,c@2'}
```
It would be nice to have a wildcard syn...Imagine a `dseries` declared as:
```
s = dseries(rand(3,6), 1, {'a1','a2','b1','b2','c1','c2'});
```
Currently, we can select all series that end with a `2` by typing:
```
s{'@a,b,c@2'}
```
It would be nice to have a wildcard syntax that would simplify this. Something like:
```
s{'*2'}
```
or
```
s{'@*@2'}
```Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/21the following syntax doesn't work but should2018-12-10T22:23:57ZHoutan Bastanithe following syntax doesn't work but should```
tseries = dseries();
ts = tseries(randn(100,1));
``````
tseries = dseries();
ts = tseries(randn(100,1));
```Stéphane Adjemianstepan@adjemian.euStéphane Adjemianstepan@adjemian.euhttps://git.dynare.org/Dynare/dseries/-/issues/46Should not fail when an empty dates object is concatenated with a dates objec...2021-05-13T14:15:31ZHoutan BastaniShould not fail when an empty dates object is concatenated with a dates object with a certain frequecyCurrently this fails:
```
[dates('1y') dates()]
```
I would propose to let it pass, having the resulting output be:
```
ans = <dates: 1Y>
```
@stepan-a what do you think?Currently this fails:
```
[dates('1y') dates()]
```
I would propose to let it pass, having the resulting output be:
```
ans = <dates: 1Y>
```
@stepan-a what do you think?