Skip to Main Content
Spark高级数据分析(第2版)
book

Spark高级数据分析(第2版)

by Sandy Ryza, Uri Laserson, Sean Owen, Josh Wills
June 2018
Beginner to intermediate content levelBeginner to intermediate
246 pages
6h 57m
Chinese
Posts & Telecom Press
Content preview from Spark高级数据分析(第2版)
182
9
接下来,以上面得到的均值和协方差为参数创建一个分布:
import org.apache.commons.math3.distribution.MultivariateNormalDistribution
val factorsDist = new MultivariateNormalDistribution(factorMeans,
factorCov)
从分布中对市场条件进行一系列采样:
factorsDist.sample()
res1: Array[Double] = Array(-0.05782773255967754, 0.01890770078427768,
0.029344325473062878, 0.04398266164298203)
factorsDist.sample()
res2: Array[Double] = Array(-0.009840154244155741, -0.01573733572551166,
0.029140934507992572, 0.028227818241305904)
9.8
 运行试验
讨论完每个金融工具的模型和市场因素回报的采样过程,现在就可以开始运行实际的试验
了。由于运行试验是个计算密集型的任务,所以我们最终还是要用
Spark
来对其并行化。
在每次试验中,我们希望提取一组风险因素样本,用该样本预测每个金融工具的回报,然
后将所有回报相加得到总体试验损失。为了使分布具有代表性,我们需要运行数千次甚至
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

大数据项目管理:从规划到实现

大数据项目管理:从规划到实现

Ted Malaska, Jonathan Seidman
管理Kubernetes

管理Kubernetes

Brendan Burns, Craig Tracey

Publisher Resources

ISBN: 9787115482525