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.22492742 -0.1346229
#> [2,] -0.32520094 0.3159176
#> [3,] 0.00000000 0.0000000
#> [4,] -0.04685391 0.9306261
thaw(input, frozen)
#> [,1] [,2]
#> [1,] -0.19479286 -0.1165868
#> [2,] -0.28163228 0.2735927
#> [3,] 0.50000000 0.5000000
#> [4,] -0.04057667 0.8059458
freeze(basis_random(4, 2), frozen)
#> [,1] [,2]
#> [1,] 0.37954586 -0.4266359
#> [2,] 0.91192702 0.2822879
#> [3,] 0.00000000 0.0000000
#> [4,] -0.04077912 0.7419938