simulate.blim: Simulate Responses from Basic Local Independence Models...

Description Usage Arguments Details Value See Also Examples

View source: R/blim.R

Description

Simulates responses from the distribution corresponding to a fitted blim model object.

Usage

1
2
## S3 method for class 'blim'
simulate(object, nsim = 1, seed = NULL, ...)

Arguments

object

an object of class blim, typically the result of a call to blim.

nsim

currently not used.

seed

currently not used.

...

further arguments passed to or from other methods. None are used in this method.

Details

Responses are simulated in two steps: First, a knowledge state is drawn with probability P.K. Second, responses are generated by applying rbinom with probabilities computed from the model object's beta and eta components.

Value

A named vector of frequencies of response patterns.

See Also

blim, endm.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
data(DoignonFalmagne7)
 
blim1 <- blim(DoignonFalmagne7$K, DoignonFalmagne7$N.R)

simulate(blim1)

## Parametric bootstrap
disc <- replicate(200, blim(blim1$K, simulate(blim1))$discrepancy)

hist(disc, col = "lightgray", border = "white", freq = FALSE, breaks = 20,
     main = "Parametric bootstrap", xlim = c(.05, .3))
abline(v = blim1$discrepancy, lty = 2)

pks documentation built on May 29, 2017, 11:26 p.m.

Related to simulate.blim in pks...