Skip to content
Snippets Groups Projects
Commit fd49f682 authored by FerhatMihoubi's avatar FerhatMihoubi
Browse files

Allow for NAN in the first argument

parent 6ef181d1
No related branches found
No related tags found
No related merge requests found
...@@ -30,10 +30,6 @@ function B = cumprod(varargin) % --*-- Unitary tests --*-- ...@@ -30,10 +30,6 @@ function B = cumprod(varargin) % --*-- Unitary tests --*--
% Get indices of the columns without NaNs % Get indices of the columns without NaNs
idx = find(~any(isnan(varargin{1}.data))); idx = find(~any(isnan(varargin{1}.data)));
if isempty(idx)
error('dseries::cumprod: All the variables have NaNs. The cumulated product cannot be computed!')
end
if ~isequal(idx(:),transpose(1:vobs(varargin{1}))) if ~isequal(idx(:),transpose(1:vobs(varargin{1})))
warning('dseries::cumprod: The cumulated product is not computed for some variables because they have NaNs!') warning('dseries::cumprod: The cumulated product is not computed for some variables because they have NaNs!')
end end
......
...@@ -30,10 +30,6 @@ function B = cumsum(varargin) % --*-- Unitary tests --*-- ...@@ -30,10 +30,6 @@ function B = cumsum(varargin) % --*-- Unitary tests --*--
% Get indices of the columns without NaNs % Get indices of the columns without NaNs
idx = find(~any(isnan(varargin{1}.data))); idx = find(~any(isnan(varargin{1}.data)));
if isempty(idx)
error('dseries::cumsum: All the variables have NaNs. The cumulated sum cannot be computed!')
end
if ~isequal(idx(:),transpose(1:vobs(varargin{1}))) if ~isequal(idx(:),transpose(1:vobs(varargin{1})))
warning('dseries::cumsum: The cumulated sum is not computed for some variables because they have NaNs!') warning('dseries::cumsum: The cumulated sum is not computed for some variables because they have NaNs!')
end end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment