From 81b49377edf2d5b08dca4b5ff3132499861244ea Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Sat, 8 Jan 2022 12:44:52 +0530 Subject: Bunch of unfinished experiments These experiments were in progress towards the end, and never properly finished. I leave the code here in case it turns out to be useful. --- src/extent-sampling.sc | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/extent-sampling.sc') diff --git a/src/extent-sampling.sc b/src/extent-sampling.sc index d46f31d..b74051f 100644 --- a/src/extent-sampling.sc +++ b/src/extent-sampling.sc @@ -52,6 +52,28 @@ (else (set accurate-estimates 0)))))))) +;; (pre-let* (WINDOW-LENGTH 1000 COVARIANCE-SAMPLES 1000 HARDCODED-ECCENTRICITY 2) +;; (define (volume-whitening extent-oracle true-volume r dimension rtol stats) +;; (void (const extent-oracle-t*) double (const gsl-rng*) (unsigned int) double gsl-rstat-workspace*) +;; (define accurate-estimates int 0) +;; (let* ((vn double (ln-volume-of-ball dimension))) +;; (with-square-matrix transform dimension +;; (gsl-matrix-set-identity transform) +;; ;; TODO: Replace hardcoded eccentricity. +;; (gsl-matrix-set transform 0 0 HARDCODED-ECCENTRICITY) +;; (with-vector x dimension +;; (with-vector y dimension +;; (do-while (< accurate-estimates WINDOW-LENGTH) +;; (random-direction-vector r x) +;; (cblas-dgemv CblasRowMajor CblasNoTrans dimension dimension 1 transform dimension x 1 0 y 1) +;; (gsl-rstat-add (exp (+ vn (* dimension (log (gsl-blas-dnrm2 y))))) +;; stats) +;; (cond +;; ((rtol? (gsl-rstat-mean stats) true-volume rtol) +;; (set+ accurate-estimates 1)) +;; (else +;; (set accurate-estimates 0)))))))))) + (sc-define-syntax (invoke-integrand integrand r x) ((: integrand integrand) r x (: integrand params))) -- cgit v1.2.3