[R] The time series analysis functions/packages don't seem to like my data

Ted Byers r.ted.byers at gmail.com
Sat Jul 4 03:32:37 CEST 2009


On Fri, Jul 3, 2009 at 9:05 PM, Mark Knecht<markknecht at gmail.com> wrote:
> On Fri, Jul 3, 2009 at 5:54 PM, Ted Byers<r.ted.byers at gmail.com> wrote:
>> Sorry, I should have read the read.zoo documentation before replying
>> to thank Gabor for his repsonse.
>>
>> Here is how it starts:
>>
>> "read.zoo(zoo) R Documentation
>>
>> Reading and Writing zoo Series
>> Description
>> read.zoo and write.zoo are convenience functions for reading and
>> writing "zoo" series from/to text files. They are convenience
>> interfaces to read.table and write.table, respectively.
>>
>> Usage
>> read.zoo(file, format = "", tz = "", FUN = NULL,
>>  regular = FALSE, index.column = 1, aggregate = FALSE, ...)"
>>
>> Clearly this should solve both our problems.
>>
>> Cheers,
>>
>> Ted
>>
>
> Possibly but I think the big issue is the findDrawdowns function is
> looking for minus signs to signal the drawdown. I down think it's
> doing calculations from a simple equity curve.
>
> All of these functions (findDrawdowns, table.Drawdowns, etc.) all say
> they will accept a data.frame.
>
> My guess is the issue isn't so much dates, names, or anything else as
> much as making sure you have a column of percentage rise and fall
> numbers expressed like
>
> 0.03
> 0.02
> -0.025
> 0.10
>
But this is trivial.  I have to read the documentation further to see
if it wants rates of return as a fraction (or percentages), or if
daily deltas will do.  Either way, it is trivial to get such numbers
(in my case in the perl script I use to draw the data from my
database.

> Even findDrawdowns(edhec[,5]) does the right thing. Copying it to R
> wasn't necessary. edhec has lots of columns. You can pick and one of
> them and get a table.
>
This is good to know as it makes some of the analyses I need to do
easier.  I can create a single file with a number of series that need
to be compared WRT drawdowns, VaR, &c.

Cheers,

Ted




More information about the R-help mailing list