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.72420454 0.3836954
#> [2,] -0.09810928 -0.5098147
#> [3,] 0.00000000 0.0000000
#> [4,] 0.14758899 0.4836459
thaw(input, frozen)
#> [,1] [,2]
#> [1,] 0.62717953 0.3322900
#> [2,] -0.08496513 -0.4415125
#> [3,] 0.50000000 0.5000000
#> [4,] 0.12781582 0.4188496
freeze(basis_random(4, 2), frozen)
#> [,1] [,2]
#> [1,] -0.1735613 0.88099275
#> [2,] 0.5262045 0.03821508
#> [3,] 0.0000000 0.00000000
#> [4,] -0.6104275 0.18476144