2011/6/23 Hiro <hiroyukin...@gmail.com>:
> # Load the LSPM package
> library(LSPM)
>
> outcomes <- cbind(
+
c(-288000,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,-77190.476,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,81781.25,360666.667,360666.667,360666.667,552000),
+
c(96416.667,-153928.571,-153928.571,-153928.571,-153928.571,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,440000,440000,440000,440000,-400000,-153928.571,-153928.571,-153928.571,-153928.571,-153928.571,-153928.571,-153928.571,-153928.571,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,96416.667,440000,658000,96416.667,96416.667,440000,-153928.571),
+
c(-137625,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,353000,353000,75307.692,75307.692,75307.692,353000,75307.692,-137625,-137625,-137625,75307.692,75307.692,75307.692,75307.692,353000,-355000,-137625,-137625,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,75307.692,353000,75307.692,353000,75307.692,535000,353000,353000),
+
c(80571.429,-204100,80571.429,80571.429,375750,-204100,80571.429,80571.429,80571.429,80571.429,375750,-204100,80571.429,-204100,-204100,80571.429,80571.429,80571.429,80571.429,80571.429,80571.429,-204100,80571.429,80571.429,80571.429,80571.429,-204100,80571.429,80571.429,-484000,-204100,80571.429,80571.429,80571.429,375750,375750,661000,80571.429,80571.429,80571.429,-204100,80571.429,80571.429,80571.429),
+
c(-105875,107305.556,-105875,107305.556,107305.556,107305.556,-105875,107305.556,107305.556,724000,107305.556,107305.556,107305.556,-105875,584500,107305.556,-105875,584500,107305.556,107305.556,107305.556,107305.556,-105875,107305.556,584500,107305.556,107305.556,107305.556,107305.556,-378000,107305.556,-105875,-105875,107305.556,107305.556,107305.556,584500,107305.556,-105875,-105875,107305.556,-105875,-105875,107305.556),
+
c(-72705.882,-72705.882,176500,176500,176500,176500,-72705.882,-72705.882,176500,692111.111,176500,176500,176500,692111.111,176500,176500,928000,176500,-427000,-72705.882,176500,-72705.882,176500,176500,176500,692111.111,-72705.882,-72705.882,176500,176500,-72705.882,-72705.882,176500,176500,-72705.882,176500,176500,692111.111,176500,692111.111,176500,692111.111,692111.111,692111.111))
>
> probs <- c(
+
0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.034482758621,0.034482758621,0.01724137931,0.068965517241,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.034482758621,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.034482758621,0.01724137931,0.01724137931,0.01724137931,0.068965517241,0.01724137931,0.068965517241,0.01724137931,0.01724137931,0.01724137931,0.034482758621,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931,0.01724137931)
>
On 6月24日, 午前9:44, Joshua Ulrich <josh.m.ulr...@gmail.com> wrote:
> That's the same as your last email. I need the contents of the "port"
> object, which you can get from running dput(port) at the R prompt.
> --
> Joshua Ulrich | FOSS Trading:www.fosstrading.com
>
> 2011/6/23 Hiro <hiroyukinarita1...@gmail.com>:
> >> - 引用テキストを表示 -- 引用テキストを表示しない -
>
> - 引用テキストを表示 -
Thanks, that was exactly what I needed. I get similar results when I
run your code. The probDrawdown result is so high because the z
values in the "port" object are still all zero (their default value).
The results are correct if you update the z values and the target
return in the "port" object with the results from the optimization:
> # z values and target return are zero
> probDrawdown(port,DDN,hrz,calcmax,errorparam,sigmaparam)
[1] 0.5897737
> port$z <- c(res$z,targetreturn) # update z values and target return
> probDrawdown(port,DDN,hrz,calcmax,errorparam,sigmaparam) # < 0.3
[1] 0.1325635
Best,
--
Joshua Ulrich | FOSS Trading: www.fosstrading.com
2011/6/24 Hiro <hiroyukin...@gmail.com>: