January 2020
Intermediate to advanced
532 pages
13h 31m
English
Using shared arrays allows us to perform parallel operations on the data from a single memory space. As long as we do not mutate the data, then these operations can run independently without conflicts. This type of problem is called embarrassingly parallel.
To illustrate the power of multi-processing, let's first benchmark a simple function that calculates the standard deviation of the returns across all securities:
using Statistics: std# Find standard deviation of each attribute for each securityfunction std_by_security(valuation) (nstates, nattr, n) = size(valuation) result = zeros(n, nattr) for i in 1:n for j in 1:nattr result[i, j] = std(valuation[:, j, i]) end end return resultend
The value of ...
Read now
Unlock full access