simulate.ontram: Simulate Responses

View source: R/methods.R

simulate.ontramR Documentation

Simulate Responses

Description

Simulate Responses

Usage

## S3 method for class 'ontram'
simulate(
  object,
  nsim = 1,
  x = NULL,
  y,
  im = NULL,
  levels = 1:ncol(y),
  seed = NULL,
  ...
)

Examples

data("wine", package = "ordinal")
fml <- rating ~ temp + contact
x_train <- model.matrix(fml, data = wine)[, -1L]
y_train <- model.matrix(~ 0 + rating, data = wine)
x_valid <- x_train[1:20,]
y_valid <- y_train[1:20,]
mo <- ontram_polr(x_dim = ncol(x_train), y_dim = ncol(y_train),
                  method = "logit", n_batches = 10, epochs = 50)
fit_ontram(mo, x_train = x_train, y_train = y_train)
simulate(mo, nsim = 1, x = x_valid, y = y_valid)

LucasKookUZH/ontram-pkg documentation built on March 27, 2023, 6:05 p.m.