rsextrobj: Extracting Encoded Sample Matrices

rsextrobjR Documentation

Extracting Encoded Sample Matrices

Description

Utility function to extract some of the generated matrices, still in encoded form.

Usage

rsextrobj(RSobj, start = 1, end = 8192)

Arguments

RSobj

object as obtained from using rsampler

start

number of the matrix to start with. When specifying 1 (the default value) the original input matrix is included in the output object.

end

last matrix to be extracted. If end is not specified, all matrices from RSobj are extracted (the maximal value is 8192, see rsctrl). If end is larger than the number of matrices stored in RSobj, end is set to the highest possible value (i.e., n_tot).

Value

A list of class RSmpl with components

n

number of rows of the input matrix

k

number of columns of the input matrix

inpmat

the input matrix

tfixed

TRUE, if diagonals of inpmat are fixed

burn_in

length of the burn in process

n_eff

number of generated matrices (effective matrices)

step

controls the number number of void matrices generated in the burn in process and when effective matrices are generated (see note in rsctrl).

seed

starting value for the random number generator

n_tot

number of matrices in outvec.

outvec

vector of encoded random matrices

ier

error code

Note

By default, all generated matrices plus the original matrix (in position 1) are contained in outvec, thus n_tot = n_eff + 1. If the original matrix is not in outvec then n_tot = n_eff.
For saving and loading objects of class RSobj see the example below.

For extracting a decoded (directly usable) matrix use rsextrmat.

See Also

rsampler, rsextrmat

Examples

ctr <- rsctrl(burn_in = 10, n_eff = 3, step=10, seed = 0, tfixed = FALSE)
mat <- matrix(sample(c(0,1), 50, replace = TRUE), nr = 10)
all_m <- rsampler(mat, ctr)
summary(all_m)

some_m <- rsextrobj(all_m, 1, 2)
summary(some_m)

## Not run: 
save(some_m, file = "some.RSobj.RData")
rm(some_m)
ls()

load("some.RSobj.RData")
summary(some_m)
## End(Not run)

eRm documentation built on May 29, 2024, 2:12 a.m.