swaptoTime: Swap to division by-month from by-location division

Description Usage Arguments Details Author(s) See Also Examples

Description

Switch input key-value pairs which is division by-location to the key-value pairs which is division by-month.

Usage

1
2
swaptoTime(input, output, cluster_control = mapreduce.control(),
  model_control = spacetime.control())

Arguments

input

The path of input file on HDFS. It should be by-location division.

output

The path of output file on HDFS. It is by-month division.

cluster_control

Should be a list object generated from mapreduce.control function. The list including all necessary Rhipe parameters and also user tunable MapReduce parameters.

model_control

Should be a list object generated from spacetime.control function. The list including all necessary smoothing parameters of nonparametric fitting.

Details

swaptoTime is used for switching division by-location to division by-month. The input key is location index, and input value is a vectorized matrix with Mlcontrol$n rows and 3 columns in order of smoothed, seasonal, trend. For each row of matrix, a new key-value pair is generated. Since the matrix is vectorized by column, the trend in ith row is i+Mlcontrol$n. Index j controls the index of multiple location in one time point.

Author(s)

Xiaosu Tong

See Also

spacetime.control, mapreduce.control

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## Not run: 
    FileInput <- "/tmp/bystatfit"
    FileOutput <- "/tmp/bymthse"

    ccontrol <- mapreduce.control(
      libLoc=NULL, reduceTask=5, io_sort=128, slow_starts = 0.5,
      reduce_input_buffer_percent=0.2, reduce_parallelcopies=10,
      reduce_merge_inmem=0, task_io_sort_factor=100,
      spill_percent=0.9, reduce_shuffle_input_buffer_percent = 0.7,
      reduce_shuffle_merge_percent = 0.5
    )
    mcontrol <- spacetime.control(
      vari = "resp", time = "date", n = 576, stat_n=7738, n.p = 12,
      s.window = "periodic", t.window = 241,
      degree = 2, span = 0.015, Edeg = 2
    )

    swaptoTime(FileInput, FileOutput, cluster_control=ccontrol, model_control=mcontrol)

## End(Not run)

XiaosuTong/drsstl documentation built on May 9, 2019, 11:06 p.m.