segTraj: segTraj: A package for segmentation and clustering of a...

Description segTraj functions Examples

Description

The foo package allows to perform a segmentation and a segmentation clustering procedure

segTraj functions

hybrid_simultanee DynProg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
K  <- 5; rupt <- sample(1:20, K+1, replace=TRUE); rupt <- cumsum(rupt); 
n <- max(rupt)
muSim <- matrix(rnorm(2*K+2,  mean=20, sd=5), nrow=2) 
muSim <- apply(muSim,1, cumsum)
muSim <- t(muSim)
sdSim <- matrix(sqrt(1/rgamma(2*K+2, shape = 10, rate = 10)), nrow=2)
print(muSim)
pos <- lapply(1:(K+1), function(d) 1*(rupt[d]<(1:n )))
pos <- Reduce('+', x=pos)+1
x <- matrix(rnorm(2*length(pos), mean=muSim[,pos], sd=sdSim[,pos]), nrow=2)
bisig_plot(x = x)
n  = dim(x)[2]
res <- hybrid_simultanee(x, P=2, Kmax=10)
Kopt=5
param <- res$param[[Kopt]]
bisig_plot(x = x, rupt = param$rupt, mu=param$phi$mu )

MarieEtienne/segTraj documentation built on May 7, 2019, 2:51 p.m.