LPM(0, NULL, x) (`actual`) not equal to 0.49 (`expected`).

`actual` is a list
`expected` is a double vector (0.49)

expect_equal(LPM(0, NULL, x), 0.49, tolerance=1e-5)
expect_equal(LPM(0, mean(x), x), 0.49, tolerance=1e-5)
expect_equal(LPM(1, mean(x), x), 0.1032933, tolerance=1e-5)
expect_equal(LPM(2, mean(x), x), 0.02993767, tolerance=1e-5)
expect_equal(LPM(0, NULL, x_df), 0.49, tolerance=1e-5)
expect_equal(LPM(0, colMeans(x_df), x_df), 0.49, tolerance=1e-5)
expect_equal(LPM(1, colMeans(x_df), x_df), 0.1032933, tolerance=1e-5)
expect_equal(LPM(2, colMeans(x_df), x_df), 0.02993767, tolerance=1e-5)
expect_equal(UPM(0, NULL, x), 0.51, tolerance=1e-5)
expect_equal(UPM(0, mean(x), x), 0.51, tolerance=1e-5)
expect_equal(UPM(1, mean(x), x), 0.1032933, tolerance=1e-5)
expect_equal(UPM(2, mean(x), x), 0.03027411, tolerance=1e-5)
expect_equal(UPM(0, NULL, x_df), 0.51, tolerance=1e-5)
expect_equal(UPM(0, colMeans(x_df), x_df), 0.51, tolerance=1e-5)
expect_equal(UPM(1, colMeans(x_df), x_df), 0.1032933, tolerance=1e-5)
expect_equal(UPM(2, colMeans(x_df), x_df), 0.03027411, tolerance=1e-5)
expect_equal(Co.UPM(0, x, y, NULL, NULL), 0.28, tolerance=1e-5)
expect_equal(Co.UPM(0, x, y, mean(x), mean(y)), 0.28, tolerance=1e-5)
expect_equal(Co.UPM(1, x, y, mean(x), mean(y)), 0.01204606, tolerance=1e-5)
expect_equal(Co.UPM(2, x, y, mean(x), mean(y)), 0.0009799173, tolerance=1e-5)
expect_equal(Co.UPM(0, x_df, y_df, NULL, NULL), 0.28, tolerance=1e-5)
expect_equal(Co.UPM(0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.28, tolerance=1e-5)
expect_equal(Co.UPM(1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01204606, tolerance=1e-5)
expect_equal(Co.UPM(2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.0009799173, tolerance=1e-5)
expect_equal(Co.LPM(0, x, y, NULL, NULL), 0.24, tolerance=1e-5)
expect_equal(Co.LPM(0, x, y, mean(x), mean(y)), 0.24, tolerance=1e-5)
expect_equal(Co.LPM(1, x, y, mean(x), mean(y)), 0.01058035, tolerance=1e-5)
expect_equal(Co.LPM(2, x, y, mean(x), mean(y)), 0.0008940764, tolerance=1e-5)
expect_equal(Co.LPM(0, x_df, y_df, NULL, NULL), 0.24, tolerance=1e-5)
expect_equal(Co.LPM(0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.24, tolerance=1e-5)
expect_equal(Co.LPM(1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01058035, tolerance=1e-5)
expect_equal(Co.LPM(2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.0008940764, tolerance=1e-5)
expect_equal(D.LPM(0, 0, x, y, NULL, NULL), 0.23, tolerance=1e-5)
expect_equal(D.LPM(0, 0, x, y, mean(x), mean(y)), 0.23, tolerance=1e-5)
expect_equal(D.LPM(1, 0, x, y, mean(x), mean(y)), 0.06404049, tolerance=1e-5)
expect_equal(D.LPM(0, 1, x, y, mean(x), mean(y)), 0.05311669, tolerance=1e-5)
expect_equal(D.LPM(1, 1, x, y, mean(x), mean(y)), 0.01513793, tolerance=1e-5)
expect_equal(D.LPM(2, 0, x, y, mean(x), mean(y)), 0.02248309, tolerance=1e-5)
expect_equal(D.LPM(0, 2, x, y, mean(x), mean(y)), 0.01727327, tolerance=1e-5)
expect_equal(D.LPM(2, 2, x, y, mean(x), mean(y)), 0.001554909, tolerance=1e-5)
expect_equal(D.LPM(0, 0, x_df, y_df, NULL, NULL), 0.23, tolerance=1e-5)
expect_equal(D.LPM(0, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.23, tolerance=1e-5)
expect_equal(D.LPM(1, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.06404049, tolerance=1e-5)
expect_equal(D.LPM(0, 1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.05311669, tolerance=1e-5)
expect_equal(D.LPM(1, 1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01513793, tolerance=1e-5)
expect_equal(D.LPM(2, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.02248309, tolerance=1e-5)
expect_equal(D.LPM(0, 2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01727327, tolerance=1e-5)
expect_equal(D.LPM(2, 2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.001554909, tolerance=1e-5)
expect_equal(D.UPM(0, 0, x, y, NULL, NULL), 0.25, tolerance=1e-5)
expect_equal(D.UPM(0, 0, x, y, mean(x), mean(y)), 0.25, tolerance=1e-5)
expect_equal(D.UPM(0, 1, x, y, mean(x), mean(y)), 0.05488706, tolerance=1e-5)
expect_equal(D.UPM(1, 0, x, y, mean(x), mean(y)), 0.05843498, tolerance=1e-5)
expect_equal(D.UPM(1, 1, x, y, mean(x), mean(y)), 0.01199175, tolerance=1e-5)
expect_equal(D.UPM(0, 2, x, y, mean(x), mean(y)), 0.01512857, tolerance=1e-5)
expect_equal(D.UPM(2, 0, x, y, mean(x), mean(y)), 0.01926167, tolerance=1e-5)
expect_equal(D.UPM(2, 2, x, y, mean(x), mean(y)), 0.0009941733, tolerance=1e-5)
expect_equal(D.UPM(0, 0, x_df, y_df, NULL, NULL), 0.25, tolerance=1e-5)
expect_equal(D.UPM(0, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.25, tolerance=1e-5)
expect_equal(D.UPM(0, 1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.05488706, tolerance=1e-5)
expect_equal(D.UPM(1, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.05843498, tolerance=1e-5)
expect_equal(D.UPM(1, 1, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01199175, tolerance=1e-5)
expect_equal(D.UPM(0, 2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01512857, tolerance=1e-5)
expect_equal(D.UPM(2, 0, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.01926167, tolerance=1e-5)
expect_equal(D.UPM(2, 2, x_df, y_df, colMeans(x_df), colMeans(y_df)), 0.0009941733, tolerance=1e-5)
expect_equal(LPM.ratio(degree=0, target=mean(x), variable=x), 0.49, tolerance=1e-5)
expect_equal(LPM.ratio(degree=1, target=mean(x), variable=x), 0.5000000000000002, tolerance=1e-5)
expect_equal(LPM.ratio(degree=2, target=mean(x), variable=x), 0.49720627, tolerance=1e-5)
expect_equal(LPM.ratio(degree=0, target=colMeans(x_df), variable=x_df), 0.49, tolerance=1e-5)
expect_equal(LPM.ratio(degree=1, target=colMeans(x_df), variable=x_df), 0.5000000000000002, tolerance=1e-5)
expect_equal(LPM.ratio(degree=2, target=colMeans(x_df), variable=x_df), 0.49720627, tolerance=1e-5)
expect_equal(UPM.ratio(degree=0, target=mean(x), variable=x), 0.51, tolerance=1e-5)
expect_equal(UPM.ratio(degree=1, target=mean(x), variable=x), 0.4999999999999999, tolerance=1e-5)
expect_equal(UPM.ratio(degree=2, target=mean(x), variable=x), 0.5027937984146681, tolerance=1e-5)
expect_equal(UPM.ratio(degree=0, target=colMeans(x_df), variable=x_df), 0.51, tolerance=1e-5)
expect_equal(UPM.ratio(degree=1, target=colMeans(x_df), variable=x_df), 0.4999999999999999, tolerance=1e-5)
expect_equal(UPM.ratio(degree=2, target=colMeans(x_df), variable=x_df), 0.5027937984146681, tolerance=1e-5)
R1 <- NNS::PM.matrix(1,1,colMeans(A), A, pop_adj = TRUE)$cov.matrix
R2 <- NNS::PM.matrix(1,1,colMeans(A), A, pop_adj = FALSE)$cov.matrix
R1 <- NNS::PM.matrix(1,1,NULL, A, pop_adj = TRUE)$cov.matrix
R2 <- NNS::PM.matrix(1,1,NULL, A, pop_adj = FALSE)$cov.matrix
"NNS::PM.matrix - Mean Target - DataFrame", {
"NNS::PM.matrix - NULL Target - DataFrame", {