From b7608d35aad271b90c625d1351b723fe9b73e148 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Mon, 28 Dec 2020 08:47:34 -0800 Subject: [PATCH] link --- csp/csp/hacs.rkt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/csp/csp/hacs.rkt b/csp/csp/hacs.rkt index 6415e3fa..3fe86d6a 100644 --- a/csp/csp/hacs.rkt +++ b/csp/csp/hacs.rkt @@ -585,7 +585,11 @@ (define/contract (optimal-stop-min proc xs) (procedure? (listof any/c) . -> . any/c) - (define-values (sample candidates) (split-at xs (inexact->exact (floor (* .458 (length xs)))))) + ;; coefficient from + ;; https://www.math.ucla.edu/~tom/Stopping/sr2.pdf + (define optimal-stopping-coefficient .458) + (define-values (sample candidates) + (split-at xs (inexact->exact (floor (* optimal-stopping-coefficient (length xs)))))) (define threshold (argmin proc sample)) (or (for/first ([candidate (in-list candidates)] #:when (<= (proc candidate) threshold))