An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-sig-finance/attachments/20070731/fc259532/attachment.pl
zoo-like classes in c++?
4 messages · Jordi Molins, Armstrong, Whit, Sean O'Riordain +1 more
no help files for this package which is why it's not on cran yet, but I'm happy to walk you through whatever you need to do. It's basically an R wrapper on top of a c++ class which implements all the time series functions. It uses POSIXct for dates. http://code.google.com/p/rseries/ -Whit
-----Original Message----- From: r-sig-finance-bounces at stat.math.ethz.ch [mailto:r-sig-finance-bounces at stat.math.ethz.ch] On Behalf Of Jordi Molins Sent: Tuesday, July 31, 2007 4:05 PM To: r-sig-finance at stat.math.ethz.ch; Jordi Molins Subject: [R-SIG-Finance] zoo-like classes in c++? I usually use zoo for my time series in R. However, sometimes my algorithms are very slow. Maybe my code is inefficient, but I need to add several for and ifs, which I believe slows down the whole calculation. I have been thinking that if I could use the C++ STL for intersections (and other operations), in addition to use the fast for and if in c++, the calculation could be much faster. My problem is that I do not know any time and date class in C++ with the same conventions as in zoo and POSIX. I have been googling, and I have found Boost.Date_Time, which apparently does quite a lot of what I want. Is zoo using some time and date class from C++? If yes, which one? if not, which one could I use? Thank you. [[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first.
This e-mail message is intended only for the named recipient(s) above. It may contain confidential information. If you are not the intended recipient you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and delete the message and any attachment(s) from your system. Thank you.
Jordi, I've been doing some work with big text files (50+mb) recently and I thought that I could only do the work in for() loops etc... I was ok up to a certain size then my machine just couldn't take it ran out of memory and I had to rework my algorithm - staying in R - I work in a corporate environment where making changes to my desktop is something that takes weeks and I just didn't have that time on the project... Eventually I figured out how to vectorise the calculations and on a small file what took minutes reduced to instantaneous, and from what was impossible took a mere 10 seconds once vectorised... Are you really sure that it is really impossible to vectorise this? cheers, Sean
On 31/07/07, Jordi Molins <jordi.molins.coronado at gmail.com> wrote:
I usually use zoo for my time series in R. However, sometimes my algorithms
are very slow. Maybe my code is inefficient, but I need to add several for
and ifs, which I believe slows down the whole calculation.
I have been thinking that if I could use the C++ STL for intersections (and
other operations), in addition to use the fast for and if in c++, the
calculation could be much faster. My problem is that I do not know any time
and date class in C++ with the same conventions as in zoo and POSIX. I have
been googling, and I have found Boost.Date_Time, which apparently does quite
a lot of what I want.
Is zoo using some time and date class from C++? If yes, which one? if not,
which one could I use?
Thank you.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first.
No, zoo does not use builtin time and date classes. It does not know anything about Date, chron, POSIXct, etc. Its completely general and only assumes that whatever classes you use are ordered (that's the O in zoo) and have certain methods defined. See ?zoo for more information on the methods assumed. For example, here we are using letters as our time/date class. The time/date class in this example is not even numeric:
library(zoo) z <- zoo(11:15, letters[1:5]) merge(z, lag(z, -1))
z lag(z, -1) a 11 NA b 12 11 c 13 12 d 14 13 e 15 14 (Actually there are a few exceptions to the above for convenience, i.e. "yearqtr" and "yearmon" classes are provided, as.Date.numeric is provided and read.zoo understands Date and POSIXct classes but overall the statement that its perfectly general is correct.)
On 7/31/07, Jordi Molins <jordi.molins.coronado at gmail.com> wrote:
I usually use zoo for my time series in R. However, sometimes my algorithms
are very slow. Maybe my code is inefficient, but I need to add several for
and ifs, which I believe slows down the whole calculation.
I have been thinking that if I could use the C++ STL for intersections (and
other operations), in addition to use the fast for and if in c++, the
calculation could be much faster. My problem is that I do not know any time
and date class in C++ with the same conventions as in zoo and POSIX. I have
been googling, and I have found Boost.Date_Time, which apparently does quite
a lot of what I want.
Is zoo using some time and date class from C++? If yes, which one? if not,
which one could I use?
Thank you.
[[alternative HTML version deleted]]
_______________________________________________ R-SIG-Finance at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-finance -- Subscriber-posting only. -- If you want to post, subscribe first.