Learn R Programming

RaschSampler (version 0.8-10)

rsextrobj: 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)

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

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).

See Also

rsampler, rsextrmat

Examples

Run this code
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)

if (FALSE) {
save(some_m, file = "some.RSobj")
some_new <- load("some.RSobj")
summary(some_new)
}

Run the code above in your browser using DataLab