Show tour animation of the data points.

animate_ts_ensemble(
  obj = NULL,
  X = NULL,
  method = NULL,
  edges = NULL,
  max_frames = Inf
)

Arguments

obj

The output from comp_tsout_ens or mv_tsout_ens functions.

X

The data matrix used as input to mv_tsout_ens (not needed if obj is output from comp_tsout_ens).

method

The dimension reduction method to apply before running the tour (if NULL tour on the full data space).

edges

Set to "all" to connect points by time index, "outlying" to connect tagged outliers to previous and following points.

max_frames

The maximum number of bases to generate in the grand tour (default is Inf).

Examples

# \donttest{
set.seed(100)
n <- 600
x <- sample(1:100, n, replace=TRUE)
x[25] <- 200
x[320] <- 300
x2 <- sample(1:100, n, replace=TRUE)
x3 <- sample(1:100, n, replace=TRUE)
x4 <- sample(1:100, n, replace=TRUE)
X <- cbind.data.frame(x, x2, x3, x4)

animate_ts_ensemble(X = X, max_frames = 10)
#> Converting input data to the required matrix format.
#> target_dist - cur_dist: 0 
#> generation:  dist =   0.3299059 
#> Using half_range 1.1

#> target_dist - cur_dist: 0.3299059 

#> target_dist - cur_dist: 0.2299059 

#> target_dist - cur_dist: 0.1299059 

#> target_dist - cur_dist: 0.02990595 
#> generation:  dist =   1.464088 

#> target_dist - cur_dist: 1.464088 

#> target_dist - cur_dist: 1.364088 

#> target_dist - cur_dist: 1.264088 

#> target_dist - cur_dist: 1.164088 

#> target_dist - cur_dist: 1.064088 

#> target_dist - cur_dist: 0.9640878 

out1 <- mv_tsout_ens(X, compr=2, fast=FALSE)
#> Registered S3 method overwritten by 'quantmod':
#>   method            from
#>   as.zoo.data.frame zoo 
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days

animate_ts_ensemble(out1, X, max_frames = 10)
#> Converting input data to the required matrix format.
#> target_dist - cur_dist: 0 
#> generation:  dist =   1.160611 
#> Using half_range 1.1

#> target_dist - cur_dist: 1.160611 

#> target_dist - cur_dist: 1.060611 

#> target_dist - cur_dist: 0.9606115 

#> target_dist - cur_dist: 0.8606115 

#> target_dist - cur_dist: 0.7606115 

#> target_dist - cur_dist: 0.6606115 

#> target_dist - cur_dist: 0.5606115 

#> target_dist - cur_dist: 0.4606115 

#> target_dist - cur_dist: 0.3606115 

#> target_dist - cur_dist: 0.2606115 


X <- X/rowSums(X)
out2 <- comp_tsout_ens(X, ncomp = 3, compr=2, fast=FALSE)
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
#> Converting from tbl_df to tbl_time.
#> Auto-index message: index = date
#> frequency = 7 days
#> trend = 91 days
animate_ts_ensemble(out2, method = "dobin", max_frames = 10)
#> target_dist - cur_dist: 0 
#> generation:  dist =   1.387398 
#> Using half_range 0.69

#> target_dist - cur_dist: 1.387398 

#> target_dist - cur_dist: 1.287398 

#> target_dist - cur_dist: 1.187398 

#> target_dist - cur_dist: 1.087398 

#> target_dist - cur_dist: 0.9873977 

#> target_dist - cur_dist: 0.8873977 

#> target_dist - cur_dist: 0.7873977 

#> target_dist - cur_dist: 0.6873977 

#> target_dist - cur_dist: 0.5873977 

#> target_dist - cur_dist: 0.4873977 

# }