[R-SIG-Finance] Possible bug in findDrawdowns
Worik
worik.stanton at gmail.com
Tue Mar 22 22:55:46 CET 2011
Given a very short series with a draw down one period from "from" to
"trough" findDrawdowns seems to find the "from" and "trough" in the same
place, but the wrong place.
For example:
> Z
Y returns.Y.
1936-02-29 14.5500 0.016632400
1936-03-31 14.9600 0.027788979
1936-04-30 13.8069 -0.080211505
1936-05-31 14.4386 0.044736709
1936-06-30 15.0402 0.040821440
1936-07-31 16.0638 0.065841677
1936-08-31 16.2057 0.008794739
1936-09-30 16.4794 0.016748084
1936-10-31 17.7146 0.072278042
1936-11-30 17.7866 0.004056206
1936-12-31 17.9616 0.009790781
> findDrawdowns(Z[,2])
$return
[1] 0.0000000 -0.0802115 0.0000000
$from
[1] 1 3 5
$trough
[1] 1 3 5
$to
[1] 3 5 12
$length
[1] 3 3 8
$peaktotrough
[1] 1 1 1
$recovery
[1] 2 2 7
There is a draw down from position 2 to trough at 3 and regains its
level in 4. But that is missed.
Either I missunderstand or this is a bug
cheers
Worik
--
If we amplify everything, we hear nothing.
--
More information about the R-SIG-Finance
mailing list