# NOT RUN {
data("EEG")
x <- EEG$x; y <- EEG$y
## Estimate the envelope dimension, which turns out to be c(1,1).
# u <- TensEnv_dim(x, y)
u <- c(1,1)
## Fit the dataset with TRR.fit
fit_1D <- TRR.fit(x, y, u, method = "1D")
## The coefficient plot and p-value plot
plot(fit_1D, xlab = "Time", ylab = "Channels", yticks = seq(64,0, length.out=5))
## Uncomment to display the plots from different methods.
# fit_ols <- TRR.fit(x, y, method = "standard")
# fit_pls <- TRR.fit(x, y, u, method = "PLS")
# plot(fit_ols, xlab = "Time", ylab = "Channels", yticks = seq(64,0, length.out=5))
# plot(fit_pls, xlab = "Time", ylab = "Channels", yticks = seq(64,0, length.out=5))
# }
Run the code above in your browser using DataLab