model_seq: Model sequence

Description Usage Arguments Value

View source: R/model-seq.R

Description

Analyses a sequence using a PPM model.

Usage

1
2
3
model_seq(model, seq, time = NULL, zero_indexed = FALSE,
  train = TRUE, predict = TRUE, return_distribution = TRUE,
  return_entropy = TRUE)

Arguments

model

A PPM model object as produced by (for example) new_ppm_simple or new_ppm_decay.

seq

An integer vector defining the input sequence (equivalently a numeric vector containing solely integers, or a factor vector, both of which which will be coerced to integer vectors).

time

(NULL or a numeric vector) Timepoints corresponding to each element of the argument seq. Only used by certain model types (e.g. decay-based models).

zero_indexed

(Logical scalar) Whether or not the seq argument is 0-indexed (i.e. drawn from an alphabet with a minimum value of 0). If FALSE, it is assumed that the sequence is 1-indexed (i.e. drawn from an alphabet with a minimum value of 1).

train

(Logical scalar) Whether or not the model should learn from the incoming sequence.

predict

(Logical scalar) Whether or not to generate predictions for each element of the incoming sequence.

return_distribution

(Logical scalar) Whether or not to return the conditional distribution over each potential continuation as part of the model output (ignored if predict = FALSE).

return_entropy

(Logical scalar) Whether or not to return the entropy of each event prediction (ignored if predict = FALSE).

Value

A tibble which will be empty if predict = FALSE and otherwise will contain one row for each element in the sequence, with the following columns:


pmcharrison/ppm documentation built on Jan. 13, 2020, 3:57 p.m.