示例#1
0
###

# Test process: Vector-Autoregressive Process, see docs in "pp"-module
a = .7
c0=.2
c1 = .6
c2 = -.6
c3 = .8
T = 1000
links_coeffs = {0: [((0, -1), a), ((1, 0), c0)],
                1: [((1, -1), a), ((0, -1), c1), ((0, 0), c0)],
                2: [((2, -1), a), ((1, -2), c2)],
                3: [((3, -1), a), ((0, -3), c3)],
                }

fulldata, true_parents_neighbors = pp.var_process(links_coeffs,
                                                  use='inv_inno_cov', T=T)
T, N = fulldata.shape

###
# Possibly supply mask as a boolean array. Samples with a "0" are masked out.
# The variable sample_selector needs to be of the same shape as fulldata.
###

sample_selector = numpy.ones(fulldata.shape).astype('bool')
# sample_selector[fulldata < -3] = False        # example of masking by value

##
# Possibly construct symbolic time series for use with measure = 'symb'
##

# (fulldata, sample_selector, T) = pp.ordinal_patt_array(
# and datatime (float array) of shape (Time,)
###

# Test process: Vector-Autoregressive Process, see docs in "pp"-module
a = .7
c1 = .6
c2 = -.6
c3 = .8
T = 1000
links_coeffs = {0: [((0, -1), a)],
                1: [((1, -1), a), ((0, -1), c1)],
                2: [((2, -1), a), ((1, -2), c2)],
                3: [((3, -1), a), ((0, -3), c3)],
                }

fulldata, true_parents_neighbors = pp.var_process(links_coeffs,
                                                  use='inv_inno_cov', T=T)
T, N = fulldata.shape

###
# Possibly supply mask as a boolean array. Samples with a "0" are masked out.
# The variable fulldata_mask needs to be of the same shape as fulldata.
###

fulldata_mask = numpy.ones(fulldata.shape).astype('bool')
# fulldata_mask[fulldata < -3] = False        # example of masking by value

##
# Possibly construct symbolic time series for use with measure = 'symb'
##

# (fulldata, fulldata_mask, T) = pp.ordinal_patt_array(
# Test process: Vector-Autoregressive Process, see docs in "pp"-module
a = .7
c1 = .6
c2 = -.6
c3 = .8
T = 1000
links_coeffs = {
    0: [((0, -1), a)],
    1: [((1, -1), a), ((0, -1), c1)],
    2: [((2, -1), a), ((1, -2), c2)],
    3: [((3, -1), a), ((0, -3), c3)],
}

fulldata_list = [
    pp.var_process(links_coeffs, use='inv_inno_cov', T=T)[0] for i in range(10)
]
# fulldata_list = [numpy.random.randn(T, 4).argsort(axis=0).argsort(axis=0)
#                  for i in range(100)]
###
# Possibly supply mask as a boolean array. Samples with a "0" are masked out.
# The variable sample_selector needs to be of the same shape as fulldata.
###

sample_selector_list = [
    numpy.ones(data.shape).astype('bool') for data in fulldata_list
]
# sample_selector[fulldata < -3] = False        # example of masking by value

##
# Possibly construct symbolic time series for use with measure = 'symb'
# Test process: Vector-Autoregressive Process, see docs in "pp"-module
a = .7
c1 = .6
c2 = -.6
c3 = .8
T = 1000
links_coeffs = {0: [((0, -1), a)],
                1: [((1, -1), a), ((0, -1), c1)],
                2: [((2, -1), a), ((1, -2), c2)],
                3: [((3, -1), a), ((0, -3), c3)],
                }

# fulldata, true_parents_neighbors = pp.var_process(links_coeffs, use='inv_inno_cov', T=T)
# T, N = fulldata.shape

fulldata_list = [pp.var_process(links_coeffs, use='inv_inno_cov', T=T)[0]
                 for i in range(10)]
# fulldata_list = [numpy.random.randn(T, 4).argsort(axis=0).argsort(axis=0)
#                  for i in range(100)]
###
# Possibly supply mask as a boolean array. Samples with a "0" are masked out.
# The variable fulldata_mask needs to be of the same shape as fulldata.
###

fulldata_mask_list = [numpy.ones(data.shape).astype('bool')
                      for data in fulldata_list]
# fulldata_mask[fulldata < -3] = False        # example of masking by value

##
# Possibly construct symbolic time series for use with measure = 'symb'
##