sim_hdchange_nbd {L2hdchange} | R Documentation |
Simulate data with neighbourhood
Description
Simulate data with neighbourhood
Usage
sim_hdchange_nbd(
n = 300,
p = 70,
nbd_info = list((1:9), (2:31), (32:41), (42:70), (3:15), (16:35), (31:55)),
sp_tp_break = rbind(c(2, 50), c(4, 150), c(2, 250)),
dist_info = list(dist = "normal", dependence = "iid", param = 1),
jump_max = 1
)
Arguments
n |
Number of time series observations. |
p |
Number of individual. |
nbd_info |
A list containing the neighbourhood information. See |
sp_tp_break |
A |
dist_info |
A list specifying the distribution of the innovation. |
jump_max |
Maximum jump size of the breaks. |
Details
'sp_tp_break' should be a K \times 2
matrix with first column
indicating the neighbourhoods and the second column indicating the time stamps.
For example, 'sp_tp_break = rbind(c(2, 50), c(4, 150), c(2, 250))' means that
the second neighbourhood has two breaks taking place at i = 50, 250
and
the fourth neighbourhood has one break taking place at i = 150
.
'dist_info' should be a list containing the following items:
dist: distribution of the innovations, either "normal" or "t".
dependence: iid or
MA(\infty)
, either "iid" or "MA_inf".param = parameter of the distribution, standard deviation for normal distribution and degree of freedom for t distribution
'jump_max' is set equal in nbd case for convenience.
See ts_hdchange()
for example.
Value
A p \times n
simulated data matrix.
Examples
data_nbd <- sim_hdchange_nbd(n = 300,
p = 70,
nbd_info =
list(
(1:9), (2:31), (32:41), (42:70),
(3:15), (16:35), (31:55)
),
sp_tp_break = rbind(c(2, 50), c(4, 150), c(2, 250)),
dist_info =
list(dist = "t", dependence = "iid", param = 5),
jump_max = 1)