The Golden Cheetah crew has now integrated R into Golden Cheetah in the latest development build. This update instantly gave Golden Cheetah statistical and modelling super-powers to the point where I gave it the nickname GoldenR Cheetah. As an example, this script uses the change point package to auto discover intervals within a power file.
As you can see, the red horizontal lines highlight the intervals discovered within the ride. You can adjust a penalty for breaking up intervals to fine tune what you are looking for.
In a follow up post I will show how to use your mean maximal power curve to then normalize your intervals as a percentage of the max duration that you can sustain that power fresh.
The script is as follows:
## R script will run on selection.
## Get the current ride or metrics
## This script requires the change point package
## Get your activity
act <- GC.activity()
## Extract your ride power data in to a time series
y <- act$power
myts <- ts(y, start=c(1), end=c(length(y)), frequency= 1)
## Discover your intervals, change the “pen.value” to adjust the penalty separating intervals
disc = cpt.mean(myts, penalty=’Manual’,pen.value=’60000*log(n)’, method=’PELT’);
## Do a happy dance that you can now do this right in GC!
plot(disc, xlab=”seconds”, ylab=”watts”, main=”Interval Discovery”, ylim=c(0, 1500));