Some terminology: * frozen variables: the variables that have fixed values * warm variables: the remaining variables that vary freely
freeze(input, frozen)
thaw(input, frozen)A frozen matrix specifies which variables to fix in a projection matrix.
Warm variables should be missing (NA) while frozen variables should
be set to their fixed values.
frozen <- matrix(NA, nrow = 4, ncol = 2)
frozen[3, ] <- .5
input <- basis_random(4, 2)
freeze(input, frozen)
#> [,1] [,2]
#> [1,] -0.2413279 -0.44809295
#> [2,] 0.7231556 0.01227077
#> [3,] 0.0000000 0.00000000
#> [4,] 0.3811904 -0.81394465
thaw(input, frozen)
#> [,1] [,2]
#> [1,] -0.2089961 -0.3880599
#> [2,] 0.6262711 0.0106268
#> [3,] 0.5000000 0.5000000
#> [4,] 0.3301206 -0.7048967
freeze(basis_random(4, 2), frozen)
#> [,1] [,2]
#> [1,] -0.01036715 0.6298478
#> [2,] 0.13056217 0.4866689
#> [3,] 0.00000000 0.0000000
#> [4,] -0.10546397 -0.5930725