aboutsummaryrefslogtreecommitdiff
path: root/tests/testthat/test_residuals.R
diff options
context:
space:
mode:
authorJohannes Ranke <jranke@uni-bremen.de>2019-10-31 01:55:01 +0100
committerJohannes Ranke <jranke@uni-bremen.de>2019-10-31 01:59:05 +0100
commit7091d3738e7e55acb20edb88772b228f6f5b6c98 (patch)
treeb6e31700074605c702662e5238162c57de330453 /tests/testthat/test_residuals.R
parent5e4ea59a41e00b05ea6664c08c7922e892e8ab77 (diff)
Add likelihood ratio test and other methods, fixes
The likelihood ratio test method is lrtest, in addition, methods for update and residuals were added.
Diffstat (limited to 'tests/testthat/test_residuals.R')
-rw-r--r--tests/testthat/test_residuals.R8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/testthat/test_residuals.R b/tests/testthat/test_residuals.R
new file mode 100644
index 00000000..0fe05b4f
--- /dev/null
+++ b/tests/testthat/test_residuals.R
@@ -0,0 +1,8 @@
+context("Residuals extracted from mkinfit models")
+
+test_that("Residuals are correctly returned", {
+ f <- fits[["FOMC", "FOCUS_C"]]
+ expect_equal(residuals(f)[1:3], c(-0.7748906, 2.7090589, -1.9451989))
+
+ expect_equivalent(residuals(f_tc_2, standardized = TRUE)[1:3], c(0.52579103, 0.40714911, 1.66394233))
+})

Contact - Imprint