tests/testthat/test-weiszfeld.R

test_that("weiszfeld", {
  n = 20
  p = 10
  t = seq(from=0,to=10,length.out=p)
  
  X = array(0,c(n,p))
  for (i in 1:n){
     X[i,] = sin(t) + stats::rnorm(p, sd=0.5)
  }

  vecL1 = as.vector(weiszfeld(X))
  expect_equal(length(vecL1), p)
})

Try the maotai package in your browser

Any scripts or data that you put into this service are public.

maotai documentation built on March 31, 2023, 6:48 p.m.