【发布时间】:2012-08-23 12:14:09
【问题描述】:
我有每月一次的宏观经济数据系列,我计划将它们用于每周(每周一)的回归分析。自新点发布以来,如何将每月发布一次的数据点与我的日期模板(当月 4 次)相匹配。
for u=2:size(daily,1)
l=find(dailytemplate(u)==monthly)
%# when the monthly date is not equal to my daily template
if isempty(l)
%# I need a clearver code for this part to find the previous release
dailyclose(u)=dailyclose(u-1)
else
dailyclose(u)=monthlyclose(l)
end
end
更新来自评论
我有以下每月宏观数据。我想用它们来喂每周的日期。例如,在 2012 年 3 月 31 日,M-input 为 2.7。因此,该日期之后的任何每周日期都应该是
W_output=2.7
截至 2012 年 4 月 30 日。然后每周W_output 将是2.3,这是新的每月点M_input。下表提供了每周W_ouput 和每月M_Input 的示例:
08/06/2012 1.7
30/06/2012 1.7
01/06/2012 1.7
31/05/2012 1.7
25/05/2012 2.3
30/04/2012 2.3
18/05/2012 2.3
31/03/2012 2.7
11/05/2012 2.3
29/02/2012 2.9
04/05/2012 2.3
31/01/2012 2.9
27/04/2012 2.7
31/12/2011 3
20/04/2012 2.7
【问题讨论】:
标签: matlab time-series datetime-select