(Arne Babenhauserheide)
2014-11-26: ensemble-estimation: use futures for calling H ensemble-estimation: use futures for calling H
diff --git a/examples/ensemble-estimation.w b/examples/ensemble-estimation.w
--- a/examples/ensemble-estimation.w
+++ b/examples/ensemble-estimation.w
@@ -33,7 +33,7 @@ exec guile -L ~/wisp --language=wisp -e
define-module : examples ensemble-estimation
use-modules : srfi srfi-42 ; list-ec
-
+ ice-9 futures ; threaded evaluation
; seed the random number generator
set! *random-state* : random-state-from-platform
@@ -134,12 +134,16 @@ Limitations: y is a single value. R and
: y_cur : car observations-to-process
R_cur : car observation-variances
y-pos_cur : car observation-positions
- Hx^b_i
+ ; calculate Hx^b_i in threads.
+ Hx^b_i-future
list-ec (: i x-deviations)
+ future
H
list-ec (: j (length i))
+ (list-ref x^b j) (list-ref i j)
. y-pos_cur
+ ; get the calculated values.
+ Hx^b_i : list-ec (: i Hx^b_i-future) : touch i
Hx^b
/ : sum-ec (: i Hx^b_i) i
. N