Using todaily() without holidays

조회 수: 10 (최근 30일)
Matthew
Matthew 2012년 8월 10일
I am trying to convert a monthly series to daily returns by rolling the monthly return forward until the next available data point. With a fints object I am using todaily() but it is automatically including holidays, i.e.
dailyTS = todaily(monthlyTS,'CalcMethod','v21x')
I dug through the source code but was unable to find an easy way to override this? I would like data to be populated for all weekdays, including holidays. Is this possible with this or another built-in function?
  댓글 수: 1
Oleg Komarov
Oleg Komarov 2012년 8월 10일
I would know how to do it without fints obj, but it's not a builtin function.

댓글을 달려면 로그인하십시오.

채택된 답변

Oleg Komarov
Oleg Komarov 2012년 8월 11일
% Sample data
data = [datenum(2012,10:13,1)',(1:4)'];
% Retrieve all days
dates = (data(1):data(end,1))';
% Remove weekends and holidays
dates = dates(isbusday(dates));
% Map longer ts to short
[tf,loc] = ismember([year(dates) month(dates)],...
[year(data(:,1)) month(data(:,1))],'rows');
% create fints
out = fints(dates,data(loc,2))
  댓글 수: 1
Matthew
Matthew 2012년 8월 13일
Thanks, accept I think is should be isbusday(dates,0) since the default for isbusday is to use holiday().

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Walter Roberson
Walter Roberson 2012년 8월 11일
Pass in the AltHolidays parameter to todaily()
  댓글 수: 1
Matthew
Matthew 2012년 8월 13일
I don't think the AltHolidays parameter is compatible with the 'CalcMethod' v21x.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Holidays / Seasons에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by