Using todaily() without holidays
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Oleg Komarov
le 10 Août 2012
I would know how to do it without fints obj, but it's not a builtin function.
Réponse acceptée
Oleg Komarov
le 11 Août 2012
% 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))
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Holidays / Seasons dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!