Description Usage Arguments Value Examples
Calculation of the New Sequence Score
1 2 3 4 5 6 7 8 9 10 11 12 | TestSeqScore(
newseq,
seqlist,
allsqs,
newsqsindex,
sqsindex,
catvec,
probabilities,
k,
beta,
lam
)
|
newseq |
New sequence to be tested. |
seqlist |
List of sequences separated by time window. |
allsqs |
Matrix containing all the possible SQS for the possible categories. |
newsqsindex |
Index Matrix indicating whether the new sequence has certain SQS's. |
sqsindex |
Index Matrix indicating which regular sequences have which SQS's. |
catvec |
Vector of the different categories found in the sequences. |
probabilities |
Estimated proportion of each category seen in the sequences. |
k |
Maximum length of sequence silhouette. |
beta |
Score parameter. |
lam |
Score parameter. |
New sequence score matrix.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | df<-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=c('A','B','A','C'))
newdf<-data.frame(Time=c("2020-01-03 01:30:20", "2020-01-03 04:19:14" , "2020-01-03 06:51:29"),
Cat=c('A','B','A'))
#For daily data:
seqlist<-SeqList(df,'%Y-%m-%d')
sqslist<-SQSList(seqlist,2)
newseqlist<-SeqList(newdf,'%Y-%m-%d')
newsqslist<-SQSList(newseqlist,2)
allsqs<-AllSQS(c('A','B','C'),2)
sqsindex<-SQSIndex(allsqs,sqslist)
newsqsindex<-SQSIndex(allsqs,newsqslist)
TestSeqScore(newseqlist[[1]],seqlist,allsqs,newsqsindex,sqsindex,c('A','B','C'),
c(0.5,0.25,0.25),2,1,0.5)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.