library(testthat)
context("Test the output of lm_ridge_beta function.")
test_that("Your lm_ridge_beta() function can return the ridge regression estimators.", {
data(X,Y)
fit_lm_ridge <- lm_ridge_beta(X,Y,10)
fit_glmnet_ridge <- glmnet_beta(X,Y,10)
expect_equivalent(fit_lm_ridge, fit_glmnet_ridge,tolerance = 1e-1)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.