optimal.time.scale: Best time-scale according to the approach by Watanabe et al....

Description Usage Arguments Details Examples

View source: R/Watanabe_functions.R

Description

This function looks for the best time-scale according to the approach by Watanabe et al. (2007a,b)

Usage

1
2
3
4
5
6
7
8
9
optimal.time.scale(
  xdat,
  maxlag = 10,
  min.win = 10,
  max.win = 20,
  n.replications = 2000,
  clust_number = 8,
  original = TRUE
)

Arguments

xdat

is a T x 1 numeric data vector

maxlag

is the maximum lag to be used to select the optimal AR lag order with AIC

min.win

is the minimum window size to be tried during the simulations

max.win

is the maximum window size to be tried during the simulations

n.replications

is the number of simulated AR(p) processes (for each window size)

clust_number

is the number of clusters for parallel computation

original

if TRUE the original method by Watanabe et al. (2007a,b) is used, otherwise a simplified approach which does not required nonlinear optimization.

Details

This function looks for the best time-scale according to the approach by Watanabe et al. (2007a,b), using either the original method or a simplified approach which does not required nonlinear optimization. The optimal windown size according to Watanabe et al. (2007a,b) is the minimum window size for which always omega(i, Ti)<=1 holds. If an estimated parameter omega(i,ti)>1, the following message is printed to the screen, "series is divergent, at least for one iteration = [", i, "], omega(i,Ti) > 1" and the function stops checking further.

Examples

1
2
3
4
5
6
 ## Not run: 
 x= arima.sim(list(order = c(3,0,0), ar = c(1.2, -0.2, -0.1)), n = 500)
 optimal.time.scale(xdat=x,maxlag=10,min.win=5,max.win=20,n.replications=2000,
 clust_number=8,original=FALSE)
 
## End(Not run)

deanfantazzini/bubble documentation built on Oct. 22, 2020, 2:43 p.m.