Skip to contents

Implementation of equation 12 in the paper.

Usage

RegSDCnew(y, yNew, x = NULL, doSVD = FALSE, ensureIntercept = TRUE)

Arguments

y

Matrix of confidential variables

yNew

Matrix of y-data for new scores

x

Matrix of non-confidential variables

doSVD

SVD when TRUE and QR when FALSE

ensureIntercept

Whether to ensure/include a constant term. Non-NULL x is subjected to EnsureIntercept

Value

Generated version of y

Details

doSVD has effect on decomposition of y and yNew. Input matrices are subjected to EnsureMatrix.

Author

Øyvind Langsrud

Examples

x <- matrix(1:5, 5, 1)
y <- matrix(rnorm(15) + 1:15, 5, 3)

# Same as IPSO (RegSDCipso)
RegSDCnew(y, matrix(rnorm(15), 5, 3), x)
#>          [,1]      [,2]     [,3]
#> [1,] 1.251707  6.806484 11.14471
#> [2,] 1.625457  7.015870 14.29224
#> [3,] 2.959632  7.798586 10.40093
#> [4,] 4.347518 10.365453 14.59771
#> [5,] 4.571298  9.533078 15.88904

# Close to y
RegSDCnew(y, y + 0.001 * matrix(rnorm(15), 5, 3), x)
#>          [,1]      [,2]     [,3]
#> [1,] 0.799432  6.142785 12.08953
#> [2,] 2.033208  7.353694 12.45028
#> [3,] 3.363452  8.717213 10.43339
#> [4,] 4.125725 10.169521 16.27939
#> [5,] 4.433795  9.136257 15.07203