Get Granger Causality interactions
get_granger_interactions.Rd
Get Granger Causality interactions
Usage
get_granger_interactions(
sv,
columns,
cond_column = "",
sig_level = 0.05,
lag = 1,
granger_fn = ms_grangertest2
)
Arguments
- sv
SplicedView object
- columns
vector of column names
- cond_column
name of conditioning column
- sig_level
significance level
- lag
in seconds (rounded to nearest frame)
- granger_fn
function to perform Granger test (defaults to ms_grangertest2)
See also
Other Granger Causality:
autoplot.GrangerTime()
,
granger_test()
,
map_to_granger_test()
,
ms_condgrangertest()
,
ms_grangertest1()
,
ms_grangertest2()
,
plot.GrangerInteraction()
,
plot_influence_diagram()
Examples
r <- get_sample_recording()
fv_list <- get_filtered_views(r, "Nose", n = 41, p = 3)
jv_sub <- get_joined_view(fv_list)
l <- list(a = c(0, 300), b = c(300, 600), c = c(600, 900))
splicing_df <- splice_time(l)
sv <- get_spliced_view(jv_sub, splicing_df)
g <- get_granger_interactions(sv, c("Nose_x_Central_Sitar", "Nose_x_Central_Tabla"), lag = 1/25)
#> Calculating Granger Test: Nose_x_Central_Sitar <--> Nose_x_Central_Tabla
print(g)
#> $gc_list
#> $gc_list$`Nose_x_Central_Sitar <--> Nose_x_Central_Tabla`
#> $df
#> Res.Df Df F P_Value Segment Var1
#> 1 1498 -1 1.41163247 0.2349740 a Nose_x_Central_Sitar
#> 2 1498 -1 0.01985323 0.8879667 a Nose_x_Central_Tabla
#> Var2 Var3
#> 1 Nose_x_Central_Tabla
#> 2 Nose_x_Central_Sitar
#>
#> $var1
#> [1] "Nose_x_Central_Sitar"
#>
#> $var2
#> [1] "Nose_x_Central_Tabla"
#>
#> $var3
#> [1] ""
#>
#> $recording
#> $data_home
#> [1] "/private/var/folders/b0/vtr2rd_96119zlr64t5hvlgr0000gp/T/Rtmp9AFYAo/temp_libpath9e3f6307ab8/movementsync"
#>
#> $data_path
#> [1] "/private/var/folders/b0/vtr2rd_96119zlr64t5hvlgr0000gp/T/Rtmp9AFYAo/temp_libpath9e3f6307ab8/movementsync/data"
#>
#> $data_files
#> [1] "NIR_ABh_Puriya_Annotation.rda"
#> [2] "NIR_ABh_Puriya_Annotation_Influence.rda"
#> [3] "NIR_ABh_Puriya_Central_Feature_Sitar.rda"
#> [4] "NIR_ABh_Puriya_Central_Pose_Sitar.rda"
#> [5] "NIR_ABh_Puriya_Central_Pose_Tabla.rda"
#> [6] "NIR_ABh_Puriya_Metre_DrutTeental.rda"
#> [7] "NIR_ABh_Puriya_Metre_VilambitTeental.rda"
#> [8] "NIR_ABh_Puriya_Onsets_Selected_DrutTeental.rda"
#> [9] "NIR_ABh_Puriya_Onsets_Selected_VilambitTeental.rda"
#> [10] "NIR_ABh_Puriya_OptFlow_Central_Sitar.rda"
#>
#> $stem
#> [1] "NIR_ABh_Puriya"
#>
#> $fps
#> [1] 25
#>
#> attr(,"class")
#> [1] "Recording"
#>
#> $order
#> [1] 1
#>
#> attr(,"class")
#> [1] "GrangerTime"
#>
#>
#> $sig_level
#> [1] 0.05
#>
#> $lag
#> [1] 0.04
#>
#> $cond_column
#> [1] ""
#>
#> attr(,"class")
#> [1] "GrangerInteraction"