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.6038761 0.7002916
#> [2,] -0.1800735 -0.4007407
#> [3,] 0.0000000 0.0000000
#> [4,] 0.7000045 0.5719757
thaw(input, frozen)
#> [,1] [,2]
#> [1,] -0.5229720 0.6064703
#> [2,] -0.1559482 -0.3470516
#> [3,] 0.5000000 0.5000000
#> [4,] 0.6062217 0.4953455
freeze(basis_random(4, 2), frozen)
#> [,1] [,2]
#> [1,] 0.2581632 -0.09488073
#> [2,] -0.7594302 -0.58362240
#> [3,] 0.0000000 0.00000000
#> [4,] -0.5952164 0.66664063