Description Usage Arguments Details Value Author(s) Examples

Function that performs the time series clustering algorithm described in Nieto-Barajas and Contreras-Cristan (2014) for annual time series data.

1 2 3 4 5 |

`data` |
Data frame with the time series information. |

`maxiter` |
Maximum number of iterations for Gibbs sampling. |

`burnin` |
Burn-in period of the Markov Chain generated by Gibbs sampling. |

`thinning` |
Number that indicates how many Gibbs sampling simulations should be skipped to form the Markov Chain. |

`level` |
Flag that indicates if the level of the time series will be considered for clustering. If TRUE, then it is taken into account. |

`trend` |
Flag that indicates if the polinomial trend of the model will be considered for clustering. If TRUE, then it is taken into account. |

`deg` |
Degree of the polinomial trend of the model. |

`c0eps` |
Shape parameter of the hyper-prior distribution on sig2eps. |

`c1eps` |
Rate parameter of the hyper-prior distribution on sig2eps. |

`c0beta` |
Shape parameter of the hyper-prior distribution on sig2beta. |

`c1beta` |
Rate parameter of the hyper-prior distribution on sig2beta. |

`c0alpha` |
Shape parameter of the hyper-prior distribution on sig2alpha. |

`c1alpha` |
Rate parameter of the hyper-prior distribution on sig2alpha. |

`priora` |
Flag that indicates if a prior on parameter "a" is to be assigned. If TRUE, a prior on "a" is assigned. |

`pia` |
Mixing proportion of the prior distribution on parameter "a". |

`q0a` |
Shape parameter of the continuous part of the prior distribution on parameter "a". |

`q1a` |
Shape parameter of the continuous part of the prior distribution on parameter "a". |

`priorb` |
Flag that indicates if a prior on parameter "b" is to be assigned. If TRUE, a prior on "b" is assigned. |

`q0b` |
Shape parameter of the prior distribution on parameter "b". |

`q1b` |
Shape parameter of the prior distribution on parameter "b". |

`a` |
Initial/fixed value of parameter "a". |

`b` |
Initial/fixed value of parameter "b". |

`indlpml` |
Flag that indicates if the LPML is to be calculated. If TRUE, LPML is calculated. |

It is assumed that the time series data is organized into a data frame with the time periods included as its row names.

`mstar` |
Number of groups of the chosen cluster configuration. |

`gnstar` |
Array that contains the group number to which each time series belongs. |

`HM` |
Heterogeneity Measure of the chosen cluster configuration. |

`arrho` |
Acceptance rate of the parameter "rho". |

`ara` |
Acceptance rate of the parameter "a". |

`arb` |
Acceptance rate of the parameter "b". |

`sig2epssample` |
Matrix that in its columns contains the sample of each sig2eps_i's posterior distribution after Gibbs sampling. |

`sig2alphasample` |
Matrix that in its columns contains the sample of each sig2alpha_i's posterior distribution after Gibbs sampling. |

`sig2betasample` |
Matrix that in its columns contains the sample of each sig2beta_i's posterior distribution after Gibbs sampling. |

`sig2thesample` |
Vector that contains the sample of sig2the's posterior distribution after Gibbs sampling. |

`rhosample` |
Vector that contains the sample of rho's posterior distribution after Gibbs sampling. |

`asample` |
Vector that contains the sample of a's posterior distribution after Gibbs sampling. |

`bsample` |
Vector that contains the sample of b's posterior distribution after Gibbs sampling. |

`msample` |
Vector that contains the sample of the number of groups at each Gibbs sampling iteration. |

`lpml` |
If indlpml = TRUE, lpml contains the value of the LPML of the chosen model. |

Martell-Juarez, D.A. and Nieto-Barajas, L.E.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ```
## Do not run
#
# data(gdp)
# tseriesca.out <- tseriesca(gdp,maxiter = 4000,level=FALSE,trend=TRUE,
# c0eps = 0.001,c1eps = 0.001,c0beta = 0.001,
# c1beta = 0.001,c0alpha = 0.001,
# c1alpha= 0.001,priorb = TRUE,a = 0,b = 0.1)
#
# The console output of the above example is:
#
# Number of groups of the chosen cluster configuration : 13
# Time series in group 1 : 1 111
# Time series in group 2 : 2 8
# Time series in group 3 : 3 4 5 6 7 10 11 12 13 14 15 16 17 18 19 20 21
# 22 24 25 26 28 29 30 31 32 33 34 35 36 37 38 40 41 42 43 44 45 46 47 49
# 50 51 52 55 56 57 58 59 61 62 63 65 67 68 69 70 71 74 75 76 77 78 79 80
# 81 82 83 84 85 86 89 92 92 93 94 95 96 97 100 101 102 103 104 105 106
# 107 108 109 110 113 114 117 118 120
# Time series in group 4 : 9 23 48 54 60 87
# Time series in group 5 : 27
# Time series in group 6 : 39
# Time series in group 7 : 53 73 88
# Time series in group 8 : 64
# Time series in group 9 : 66 98 112
# Time series in group 10 : 72
# Time series in group 11 : 90 116 119 121
# Time series in group 12 : 99
# Time series in group 13 : 115
# HM Measure : 99.50627
#
# Make sure that chain convergence is always assessed. Run the following
# code to show the cluster and diagnostic plots:
data(gdp)
data(tseriesca.out)
attach(tseriesca.out)
clusterplots(tseriesca.out,gdp)
diagplots(tseriesca.out)
``` |

BNPTSclust documentation built on May 30, 2017, 6:09 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.