One of the great frustrations for a newbie to R is the documentation uses the same syntax in its description as the items it is trying to describe, a general no-no when giving language definitions. Why does the documentation not include the equation being represented by the function, thereby clarifying what the function is doing?? That gripe aside, can anyone explain to me what the rate of change (ROC) function in the TTR package is doing? I have run it on a set of returns and I cannot reverse engineer what it is calculating. Also, what is the difference between the discrete and the continuous types?? Thanks. wizardchef
On Nov 16, 2014, at 5:54 PM, Ernie Stokely wrote:> One of the great frustrations for a newbie to R is the documentation uses the same syntax in its description as the items it is trying to describe, a general no-no when giving language definitions. Why does the documentation not include the equation being represented by the function, thereby clarifying what the function is doing?? >If you have issues with the documentation of non-recommended packages, you should address them to the maintainer. There is a maintainer function:> maintainer("TTR")[1] "Joshua Ulrich <josh.m.ulrich at gmail.com>"> That gripe aside, can anyone explain to me what the rate of change (ROC) function in the TTR package is doing? I have run it on a set of returns and I cannot reverse engineer what it is calculating. Also, what is the difference between the discrete and the continuous types?? Thanks.It's rather simple to look at the code. Just type: TTR::ROC> wizardchefReading the code is considered an important first step in answering such questions. -- David Winsemius Alameda, CA, USA
On Nov 16, 2014 8:10 PM, "Ernie Stokely" <wizardchef at gmail.com> wrote:> > One of the great frustrations for a newbie to R is the documentation usesthe same syntax in its description as the items it is trying to describe, a general no-no when giving language definitions. Why does the documentation not include the equation being represented by the function, thereby clarifying what the function is doing??>A great frustration for those who took time to attempt to provide useful documentation is when people criticize it instead of providing patches to improve it. The documentation is often written by the authors of the code and it's extremely difficult to view it through the eyes of a neophyte when it's something you know so intimately.> That gripe aside, can anyone explain to me what the rate of change (ROC)function in the TTR package is doing? I have run it on a set of returns and I cannot reverse engineer what it is calculating. Also, what is the difference between the discrete and the continuous types?? Thanks.>It's calculating log first differences, or continuously compounded returns. The discrete type is p(t)/p(t-1)-1. You also have the source code and could have referenced it in your attempt to reverse engineer the calculations.> wizardchef > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guidehttp://www.R-project.org/posting-guide.html> and provide commented, minimal, self-contained, reproducible code.[[alternative HTML version deleted]]