Model_Matrix_generation: A function that generate model matrix.

Description Usage Arguments Details Value Examples

View source: R/Model_Matrix_generation.R

Description

A function that generate model matrix from the return, volume, and the trade number data.

Usage

1
2
3
4
Model_Matrix_generation(All_dta_dir, RV_raw_dta_dir, RV_C_dta_dir,
  RV_D_dta_dir, lag_days = 10, long_memory_tests = TRUE, acf = TRUE,
  sec = 1800, peak_param = c(0.995, 0.985), sub_title = "",
  save_dir = "unnamed", ...)

Arguments

All_dta_dir

The directory for the CSV file containing the raw volume data.

RV_raw_dta_dir

The directory for the dta file containing the realized variance without periodicity standardization.

RV_C_dta_dir

The directory for the dta file containing the realized variance with constant periodicity standardization.

RV_D_dta_dir

The directory for the dta file containing the realized variance with daily periodicity standardization.

lag_days

The maximum lagging days of acf plot, default = 5.

long_memory_tests

Wheather perform long memory tests or not, default = TRUE

acf

Wheather to save acf plots or not, default = TRUE

sec

Seconds between intervals, default = 1800.

peak_param

The threashold for peak values quantiles, default = 0.995.

sub_title

The subtitle of the figures, default = "".

save_dir

The directory to save the model matrix and the figures.

All_dta_dir

The directory for the CSV file containing the raw volume data.

Details

This function will automatically generate a comprehensive model matrix involving return, volume, and trade number data.

Additional predictors include return of the previous 12 time points and the dummy variable for friday.

Value

3 model matrixes will be saved under the folder named by save_dir.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 

SherryChapter1::Model_Matrix_generation(
All_dta_dir = "MSFT 1800 Sec Summary Return Data.dta",
RV_raw_dta_dir = "MSFT 1800 Sec my daily.dta",
RV_C_dta_dir = "MSFTC 1800 Sec my daily.dta",
RV_D_dta_dir = "MSFTD 1800 Sec my daily.dta",
sec = 1800,
sub_title = "MSFT",
save_dir = "MSFT_1800",
peak_param = c(0.995,0.985)
)


## End(Not run)

ZhenWei10/Sherry-Chapter1 documentation built on Oct. 31, 2019, 1:48 a.m.