IRASD_RegScoreInput: Results for Irregular Activity Sequence Detection with...

Description Usage Arguments Details Value Examples

View source: R/IRASD_RegScoreInput.R

Description

Results for Irregular Activity Sequence Detection with Regular Sequence Score as an Input

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
IRASD_RegScoreInput(
  regseqscore,
  newseqdf,
  seqdf,
  timetype,
  k,
  beta,
  lam,
  percentpwr,
  bndwidth,
  kern
)

Arguments

regseqscore

Regular sequence scores.

newseqdf

Dataframe of new sequences to be tested: first column time stamps in POSIXct format, second column sequence vector in factor format.

seqdf

Dataframe of regular sequences: first column time stamps in POSIXct format, second column sequence vector in factor format.

timetype

ime window for separating the dataset, i.e. day = '%Y-%m-%d', week = '%Y-%W' and month '%Y-%m'.

k

Maximum length of sequence silhouette.

beta

Score parameter.

lam

Score parameter.

percentpwr

Significance level.

bndwidth

Bandwidth for the KDE (refer to stats::density function for options).

kern

Kernel of choice for the KDE (refer to stats::density function for options).

Details

Ensure lam(k-1)k/2<beta to comply with the method constraints.

Value

A list with the results of the test, showing which SQS have flagged as irregular.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
seqdf <- data.frame(Time = c(
  "2020-01-01 00:10:09", "2020-01-01 01:12:34", "2020-01-02 06:38:09",
  "2020-01-02 07:21:51"
), Cat = as.factor(c("A", "B", "A", "C")))
newseqdf <- data.frame(
  Time = c("2020-01-03 01:30:20", "2020-01-03 04:19:14", "2020-01-03 06:51:29"),
  Cat = as.factor(c("A", "B", "A"))
)
# For daily data:
regseqscore <- RegScoreWrapper(seqdf, "%Y-%m-%d", 2, 1, 0.5)
IRASD_RegScoreInput(regseqscore, newseqdf, seqdf, "%Y-%m-%d", 2, 1, 0.5, 0.05, "nrd0", "gaussian")

jgillam13/IRASD documentation built on Feb. 10, 2021, 9:38 a.m.