tests/testthat/test_gcvlwls1d1.R

 cat("\nTests for 'GCVLwls1D1.R'")

load(system.file('testdata', 'dataForGcvLwlsTest.RData', package='fdapace'))

test_that("basic  optimal bandwidth choice for the mean function use GCV method matches MATLAB for Sparse data", {

  A <- GCVLwls1D1(y,t,'epan',1,0,'Sparse') 
  expect_equal( A$bOpt, 2.071354057811459 ) 

  B <- GCVLwls1D1(y,t,'rect',1,0,'Sparse') 
  expect_equal( B$bOpt, 2.238990337557121, 0.04 ) 

 } )
hadjipantelis/tPACE documentation built on Aug. 16, 2022, 10:45 a.m.