R : Copyright 2005, The R Foundation for Statistical Computing Version 2.1.1 (2005-06-20), ISBN 3-900051-07-0 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for a HTML browser interface to help. Type 'q()' to quit R. > ### *
> ### > attach(NULL, name = "CheckExEnv") > assign(".CheckExEnv", as.environment(2), pos = length(search())) # base > ## add some hooks to label plot pages for base and grid graphics > setHook("plot.new", ".newplot.hook") > setHook("persp", ".newplot.hook") > setHook("grid.newpage", ".gridplot.hook") > > assign("cleanEx", + function(env = .GlobalEnv) { + rm(list = ls(envir = env, all.names = TRUE), envir = env) + RNGkind("default", "default") + set.seed(1) + options(warn = 1) + delayedAssign("T", stop("T used instead of TRUE"), + assign.env = .CheckExEnv) + delayedAssign("F", stop("F used instead of FALSE"), + assign.env = .CheckExEnv) + sch <- search() + newitems <- sch[! sch %in% .oldSearch] + for(item in rev(newitems)) + eval(substitute(detach(item), list(item=item))) + missitems <- .oldSearch[! .oldSearch %in% sch] + if(length(missitems)) + warning("items ", paste(missitems, collapse=", "), + " have been removed from the search path") + }, + env = .CheckExEnv) > assign("..nameEx", "__{must remake R-ex/*.R}__", env = .CheckExEnv) # for now > assign("ptime", proc.time(), env = .CheckExEnv) > grDevices::postscript("mAr-Examples.ps") > assign("par.postscript", graphics::par(no.readonly = TRUE), env = .CheckExEnv) > options(contrasts = c(unordered = "contr.treatment", ordered = "contr.poly")) > options(warn = 1) > library('mAr') > > assign(".oldSearch", search(), env = .CheckExEnv) > assign(".oldNS", loadedNamespaces(), env = .CheckExEnv) > cleanEx(); ..nameEx <- "mAr.eig" > > ### * mAr.eig > > flush(stderr()); flush(stdout()) > > ### Name: mAr.eig > ### Title: Eigendecomposition of m-variate AR(p) model > ### Aliases: mAr.eig > ### Keywords: multivariate > > ### ** Examples > > data(pinkham) > y=mAr.est(pinkham,2,5) > mAr.eig(y$AHat,y$CHat) $modes periods dampTime [1,] 25.84734 4.2848063 [2,] 25.84734 4.2848063 [3,] 15.98256 0.5620364 [4,] 15.98256 0.5620364 $eigv [,1] [,2] [,3] [1,] -0.3950117+0.11940948i -0.3950117-0.11940948i -0.2566485+0.23908075i [2,] -0.6664679+0.01206423i -0.6664679-0.01206423i 0.9197634+0.05756759i [,4] [1,] -0.2566485-0.23908075i [2,] 0.9197634-0.05756759i > > > > > cleanEx(); ..nameEx <- "mAr.est" > > ### * mAr.est > > flush(stderr()); flush(stdout()) > > ### Name: mAr.est > ### Title: Estimation of multivariate AR(p) model > ### Aliases: mAr.est > ### Keywords: multivariate > > ### ** Examples > > data(pinkham) > y=mAr.est(pinkham,2,5) > > > > cleanEx(); ..nameEx <- "mAr.pca" > > ### * mAr.pca > > flush(stderr()); flush(stdout()) > > ### Name: mAr.pca > ### Title: Multivariate autoregressive analysis in PCA space > ### Aliases: mAr.pca > ### Keywords: multivariate > > ### ** Examples > > > data(sparrows) > A=mAr.est(sparrows,1)$AHat > mAr.eig(A)$modes periods dampTime [1,] 9.910152 1.0302191 [2,] 9.910152 1.0302191 [3,] 2.268032 0.8545396 [4,] 2.268032 0.8545396 [5,] Inf 0.5553247 > mAr.pca(sparrows,1,k=4)$modes periods dampTime [1,] 8.901284 0.7418931 [2,] 8.901284 0.7418931 [3,] 2.050779 0.6368430 [4,] 2.050779 0.6368430 > > > > > cleanEx(); ..nameEx <- "mAr.sim" > > ### * mAr.sim > > flush(stderr()); flush(stdout()) > > ### Name: mAr.sim > ### Title: Simulation from a multivariate AR(p) model > ### Aliases: mAr.sim > ### Keywords: multivariate > > ### ** Examples > > w=c(0.25,0.1) > C=rbind(c(1,0.5),c(0.5,1.5)) > A=rbind(c(0.4,1.2,0.35,-0.3),c(0.3,0.7,-0.4,-0.5)) > x=mAr.sim(w,A,C,N=300) Loading required package: MASS > > > > ### *