1. Learn
  2. /
  3. Courses
  4. /
  5. Parallel Programming in R

Connected

Exercise

Reproduce the bootstrap

You work for an online stock brokerage. Your firm is developing an Android app that provides general price ranges for stocks sold by the firm. A bootstrapping function, boot_price(), is available for you to calculate monthly price ranges.

To test the reproducibility of this function in parallel, you have decided to apply this function to every element of a list, ls_micro. Each element of this list is a vector of average daily Microsoft stock prices for a given month.

The parallel package has been loaded for you.

Instructions

100 XP
  • Set a seed value of 321 for the cl1 cluster to do the first run.
  • Set the same seed value for the cl2 cluster to do the second run.
  • Test if outputs result1 and result2 are the same.