plot.ghcm: Plotting function for the 'ghcm'-class.

Description Usage Arguments Value Examples

View source: R/main.R

Description

Plots the observed test statistic of a performed GHCM test together with a density estimate of the estimated asymptotic distribution of the test statistic under the null.

Usage

1
2
## S3 method for class 'ghcm'
plot(x, bw = "SJ", ...)

Arguments

x

ghcm-object. The result of running a ghcm_test.

bw

a string or numeric. If bw is a string, it should specify a bandwidth method for the density function in the stats package. If bw is a numeric, it will be used as the bandwidth in the call to density.

...

additional plotting parameters.

Value

None.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1)
library(refund)
data(ghcm_sim_data)

# Test independence of two scalars given a functional variable

m_1 <- pfr(Y_1 ~ lf(Z), data=ghcm_sim_data)
m_2 <- pfr(Y_2 ~ lf(Z), data=ghcm_sim_data)
test <- ghcm_test(resid(m_1), resid(m_2), X_grid = NA, Y_grid = NA )
plot(test)

ghcm documentation built on Jan. 25, 2021, 5:08 p.m.