<commit_before>package probability.random

import au.id.cxd.math.probability.analysis.AndersonDarling
import au.id.cxd.math.probability.continuous.Normal
import au.id.cxd.math.probability.random.RNormal
import org.scalatest.{FlatSpec, Matchers}

class TestRNormal extends FlatSpec with Matchers {

  "unit circle" should "be produced by RNorm" in {
    val rnorm = RNormal()
    val unit = rnorm.unitCircle
    println(unit)


  }

  "random normal draws" should "be from normal dist N(0,1)" in {
    val rnorm = RNormal()
    val samples = rnorm.draw(100)
    println(samples)

    // perform test for normality eg: Shapiro-Wilks or Anderson Darling test.
    val norm = Normal(mu=0.0)(1.0)
    val cdf = (x:Double) => norm.cdf(x)
    val test = AndersonDarling(samples, cdf)
    val result = test.test(0.05)
    println(result.toString)
    result.reject should be (false)
  }


}
<commit_msg>work in progress on univariate normality tests<commit_after>package probability.random

import au.id.cxd.math.probability.analysis.AndersonDarling
import au.id.cxd.math.probability.continuous.Normal
import au.id.cxd.math.probability.random.RNormal
import org.scalatest.{FlatSpec, Matchers}

class TestRNormal extends FlatSpec with Matchers {

  "unit circle" should "be produced by RNorm" in {
    val rnorm = RNormal()
    val unit = rnorm.unitCircle
    println(unit)


  }

  "random normal draws" should "be from normal dist N(0,1)" in {
    val rnorm = RNormal()
    val samples = rnorm.draw(100)
    println(samples)

    // perform test for normality eg: Shapiro-Wilks or Anderson Darling test.
    val norm = Normal(mu=0.0)(1.0)
    val cdf = (x:Double) => norm.cdf(x)
    val test = AndersonDarling(samples, cdf)
    val result = test.test(0.001)
    println(result.toString)
    result.reject should be (false)
  }


}

{'fraction_non_alphanumeric': 0.10635964912280702, 'fraction_numerical': 0.013706140350877192, 'mean_word_length': 3.5511221945137157, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1788147', 'n_tokens_mistral': 646, 'n_tokens_neox': 601, 'n_words': 162}