Skip to content
Snippets Groups Projects
Commit c1863669 authored by SANTAGOSTINI Pierre's avatar SANTAGOSTINI Pierre
Browse files

Tests estparnormratio

parent 3715b3a1
No related branches found
No related tags found
No related merge requests found
set.seed(1234)
x1 <- rnorm(2048, 1, 5)
y1 <- rnorm(2048, 10, 10)
z1 <- x1/y1
beta1 <- 0.1; rho1 <- 2; delta1 <- 1
theta1 <- estparnormratio(z1, eps = 1e-6)
test_that("estparnormratio works 1", {
expect_equal(round(theta1$beta, 1), beta1)
expect_equal(round(theta1$rho, 0), rho1)
expect_equal(round(theta1$delta, 1), delta1)
})
set.seed(1234)
x2 <- rnorm(2048, 0, 5)
y2 <- rnorm(2048, 10, 10)
z2 <- x2/y2
beta2 <- 0; rho2 <- 2; delta2 <- 1
theta2 <- estparnormratio(z2, eps = 1e-6)
test_that("estparnormratio works 2", {
expect_equal(round(theta2$beta, 1), beta2)
expect_equal(round(theta2$rho, 1), rho2)
expect_equal(round(theta2$delta, 1), delta2)
})
set.seed(1234)
x3 <- rnorm(2048, -1.5*20, 20/3)
y3 <- rnorm(2048, 20, 20/3*1.5)
z3 <- x3/y3
beta3 <- -1.5; rho3 <- 1.5; delta3 <- 0.5
theta3 <- estparnormratio(z3, eps = 1e-6)
test_that("estparnormratio works 3", {
expect_equal(round(theta3$beta, 1), beta3)
expect_equal(round(theta3$rho, 1), rho3)
expect_equal(round(abs(theta3$delta), 2), delta3)
})
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment