Rs
Module 5Collections LabLesson 7 of 825 min

Pipeline Lab: Prices to Stats

prices → returns → mean/std → annualized vol.

Lab goals

  1. Vec of prices
  1. simple returns via windows
  1. mean and sample std
  1. annualize with sqrt(252)

Print intermediates at each stage.

Challenge

Repeat with log returns and compare ann vol.

Tips
  • n-1 sample std
  • Print intermediates
  • Reused in Module 8

Try it live

Pipeline Lab: Prices to StatsRust 2021
Loading editor…
Output
Press Run to compile and execute.