Skip to contents

Runs verification tests on the A2-KL optimization algorithm.

Usage

verify_a2_kl(verbose = TRUE)

Arguments

verbose

Logical; if TRUE, print detailed results.

Value

Logical; TRUE if all tests pass.

Examples

verify_a2_kl()
#> ============================================================
#> A2-KL Optimization Verification
#> ============================================================
#> 
#> Test 1: Convergence for typical target (method='chisq')
#>   Target: mu_K = 5.0, var_K = 8.0
#>   Result: a = 2.2363, b = 1.7627
#>   Achieved: mu_K = 5.0200, var_K = 7.6403
#>   KL = 5.0296e-03, status = 'success'
#>   [PASS]
#> 
#> Test 2: Reasonable KL divergence (< 0.1)
#>   KL = 5.0296e-03 [PASS]
#> 
#> Test 3: Moment approximation quality
#>   Mean error: 0.0200 (< 0.5)
#>   Var error: 0.3597 (< 2.0)
#>   [PASS]
#> 
#> Test 4: Custom binomial-shaped PMF target (method='pmf')
#>   Result: a = 6.8423, b = 7.8933
#>   KL = 1.8756e-03, status = 'success'
#>   [PASS]
#> 
#> Test 5: Fallback mechanism check
#>   Result: a = 2001817.5288, b = 3269017.3725, KL = 7.3671e-03
#>   Fallback used: FALSE
#>   [PASS]
#> 
#> ============================================================
#> Overall: ALL TESTS PASSED
#> ============================================================