Convert daily prices to monthly returns

1 view (last 30 days)
V
V on 7 May 2013
Hi Matlab Users,
I have a time series of daily prices. I want to get prices for the first and the last trading day of a month so that I can compute monthly returns.
A_1=[C(:,1) C(:,7)]; A_1 is a matrix of dates and prices. A_M=tomonthly(A_1, 'BusDays', 1); Unfortunately, I get an error message: Undefined function 'tomonthly' for input arguments of type 'double'.
I have access to the financial toolbox and should be able to use tomonthly.
Alternatively, I could do it with the financial time series GUI but it did not import my data. I tried with an xls and a txt file. Matlab files should have the extension mat but mine only have m.
Could anyone please help me out.
Thanks a lot!

Answers (1)

Sean de Wolski
Sean de Wolski on 7 May 2013
Edited: Sean de Wolski on 7 May 2013
First, tomonthly is a method of a fints object. Thus you first have to create an object of this type:
doc fints
If A_1 is a fints object, then do you have the Financial Toolbox installed?
You can check this by running:
ver
If it is installed, what is the full output of:
which -all tomonthly
  1 Comment
V
V on 7 May 2013
Thank you Sean! I will try fints object. This was probably the mistake.
The full output of which -all tomonthly is /Applications/MATLAB_R2012a.app/toolbox/finance/ftseries/@fints/tomonthly.m % fints method

Sign in to comment.

Categories

Find more on MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!