Re: [R] wilderSum

2012-02-08 Thread Joshua Ulrich
Yuanwei,

You are correct.  The initial seed value is the raw sum, starting with
TTR_0.21-0.

As it says in the TTR/CHANGES file (among other things):
- Changed wilderSum to seed initial value with raw sum. This matches
Wilder's original calculations. Thanks to Mahesh Bp for the report.

HTH,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com



On Wed, Feb 8, 2012 at 3:50 AM, yuanwei  wrote:
> Hi  Joshua,
>
>    Before I found your post here, I have viewed your source code for
> 'wilderSum' to
> figure out how wilderSum works - I re-write a piece of R code to implement
> the algorithm as in your source code, but failed to get the right result as
> wilderSum function in TTR. Glad to see your explanation here for wilderSum,
> but I am still confused by the source code: the initial value(sum) for the
> iterator seems to be a simple sum of first (n-1) X's...
>
>   Thanks for your kind help in advance!
>
> yuanwei
>
> --
> View this message in context: 
> http://r.789695.n4.nabble.com/wilderSum-tp846599p4368945.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] wilderSum

2012-02-08 Thread yuanwei
Hi  Joshua,

Before I found your post here, I have viewed your source code for
'wilderSum' to
figure out how wilderSum works - I re-write a piece of R code to implement
the algorithm as in your source code, but failed to get the right result as
wilderSum function in TTR. Glad to see your explanation here for wilderSum,
but I am still confused by the source code: the initial value(sum) for the
iterator seems to be a simple sum of first (n-1) X's...

   Thanks for your kind help in advance!

yuanwei 

--
View this message in context: 
http://r.789695.n4.nabble.com/wilderSum-tp846599p4368945.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] wilderSum

2008-02-06 Thread Josh Ulrich
Shubha,

The calculation is:

wilderSum[1] <- x[1]
for(i in 2:NROW(x)) {
  wilderSum[i] <- x[i] + wilderSum[i-1] * (n-1)/n
}

Where 'x' is the price series and 'n' is the number of periods.

You can see the calculations for all functions in TTR's source code,
which is on CRAN and r-forge
(http://r-forge.r-project.org/projects/ttr/).

Please feel free to contact me directly regarding questions about TTR.

Best,
Josh

On Feb 6, 2008 8:22 AM, Shubha Vishwanath Karanth
<[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> Can somebody tell me the formula for "?wilderSum" in TTR package? I mean how
> are these calculated?
>
> BR, Shubha
>
> Shubha Karanth | Amba Research
>
> Ph +91 80 3980 8031 | Mob +91 94 4886 4510
>
> Bangalore • Colombo • London • New York • San José • Singapore •
> www.ambaresearch.com
>
>   This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this
> e-mail in error) please notify the sender immediately and destroy this
> e-mail. Any unauthorized copying, disclosure or distribution of
> the material in this e-mail is strictly forbidden. Any views or opinions
> presented are solely those of the author and do not
> necessarily represent those of Amba Holdings Inc., and/or its affiliates.
> Important additional terms relating to this email can be obtained
> at http://www.ambaresearch.com/disclaimer
>
>

-- 
http://quantemplation.blogspot.com

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] wilderSum

2008-02-06 Thread Shubha Vishwanath Karanth
Hi,

 

Can somebody tell me the formula for "?wilderSum" in TTR package? I mean how 
are these calculated?

 

BR, Shubha

Shubha Karanth | Amba Research

Ph +91 80 3980 8031 | Mob +91 94 4886 4510 

Bangalore * Colombo * London * New York * San José * Singapore * 
www.ambaresearch.com

 

This e-mail may contain confidential and/or privileged i...{{dropped:13}}

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.