# [R-SIG-Finance] Curvature related question

Eric Zivot ezivot at u.washington.edu
Tue Apr 7 19:50:18 CEST 2009

```You might want to look at the following paper which describes some simple
algorithms for determining turning points in business cycles.
Ez

http://www.eabcn.org/research/documents/Harding_Pagan.pdf

-----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 Vorlow
Constantinos
Sent: Tuesday, April 07, 2009 6:10 AM
To: r-sig-finance at stat.math.ethz.ch
Subject: [R-SIG-Finance] Curvature related question

Hello...

Is there a quick and easy way to determine how curvature changes (along
time) on a smoothed version (or trend) of a time series?

i.e.

in the following code, I wan to check (possibly vith a combination of
rollapply function, where the peaks and troughs are on the idx variable
-and, IF they are peaks or troughs- which is a 15 day moving average of
the SP500 index...

library(tseries)
SP500 <- get.hist.quote("^GSPC", start = "2006-01-01", quote =
"Close")
idx1 <- rollapply(SP500, 15, align="right", function(x) mean(x))

Have experimented a bit with the derivatives functions but I can't make
it really work properly... The fact that the sequences are also  zoo
objects and I would like to retain their time stamp properties
complicates things for my code...

If there is a better and faster way (possibly finding a local max or
min), I would appreciate some pointers.

Costas

P Think before you print.

Disclaimer:
This e-mail is confidential. If you are not the intended recipient, you
should not copy it, re-transmit it, use it or disclose its contents, but
should return it to the sender immediately and delete the copy from your
system.
EFG Eurobank Ergasias S.A. is not responsible for, nor endorses, any
opinion, recommendation, conclusion, solicitation, offer or agreement or any
information contained in this communication.
EFG Eurobank Ergasias S.A. cannot accept any responsibility for the accuracy
or completeness of this message as it has been transmitted over a public
network. If you suspect that the message may have been intercepted or

[[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.

```