Thursday, April 28, 2011

Creating a monthly series from daily data

Today I came across the issue of converting a daily time-series to display and calculate only on end-of-month data.
Turns out that a series type cannot display the month, number combo directly in my workspace so a little workaround is needed.
In this example I start with a from and to date, in date format. Then we extract the starting month and end month for the series. Then we fill the series object with monthly data (using the move_bus_days to get the last business day of each month.
Lastly we want to plot the data so we fill the non-equidistant pair of dates and numbers in a vector of point date so that it can be displayed in a graph.
Problem solved: