Hi,
On Wed, May 12, 2010 at 12:11 PM, Makada Henry <mhenry_888 at msn.com>
wrote:>
> Hi, I am brand new to R and not familiar with the language, though I
> have been reading the manuals and making some slow going progress. I am
> working with some source code from a Global Vector Auto -Regressive
> program written by Ranier Puhr from the R-forge group. I need help
> interpreting the processes of the following code.
>
> I am going to
> post in parts since it's pretty long:
I'm going to cut it off here and simply ask "what part don't you
get"?
Although the formatting is screwy, it just look like a lot of book
keeping type of code to me ...
-steve
>
>
> GVAR <- function (data, tw = NULL, p, q = p, r = NULL, weight, case,
> exo.var = FALSE,
> ? ? d = NULL, endo = NULL, ord = NULL, we = NULL,
> method = "max.eigen")
>
> ? ?# ? ? data ... timeseries data as list (each entry is a matrix of a
subsystem of variables,
> ? # ? ? ? ? ? ? ?if exo.var=TRUE the last entry are exogeneous variables)
> ? # ? ? ? tw ... time window, vector of start and end point
> ? # ? ? ? ?p ... scalar/vector of endogenous lags, (N+1)x1
> ? # ? ? ? ?q ... scalar/vector of weakly exogeneous lags, (N+1)x1
> ? # ? ? ? ?r ... vector of cointegrating relations
> ? # ? weight ... weight matrix of dimension (N+1)x(N+1)
> ? # ? ? case ... scalar/vector of cases ("I" to "V"),
(N+1)x1
> ? # ? ? endo ... list of endogenous variables used
> ? # ? ? ?ord ... list showing the same variables for weakly exogeneous
analysis
> ? # ? ? ? we ... list with numbers of weakly exogeneous variables included
in each VECM,
> ? # ? ? ? ? ? ? ?corresponds to numbers in ord
> ? # ?exo.var ... if TRUE strictly exogeneous variables are included in the
model
> ? # ? ? ? ?d ... list showing which strictly exogeneous variables enter the
subsystem equations
> ? # ? ? ?lex ... scalar/vector of lags of exogenous variables
> ? # ? method ... select cointegrating rank by max. eigenvalue
("max.eigen") or trace statistic ("trace")
>
>
> # ----- Set subsystems -----
>
>
> ?cmodel <- list()
>
> ?N <-
> length(data)-1 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? # number of
> subsystems i=0,1,...,N
> ?dims <- vector()
> ?for (i in 1:(N+1))
>
> ?{
> ? ? ?if (!is.null(dim(data[[i]])))
> ? ? ?{
>
> dims[i] <- dim(data[[i]])[1]
> ? ? ?} else {
> ? ? ? ? ?dims[i]
> <- length(data[[i]])
> ? ? ?}
> ?}
> ?max.dim <- max(dims)
>
>
> ?tsi <- tsp(data[[((1:length(dims))[dims==max(dims)])[1]]])
>
> ?if (is.null(tw))
> ?{
> ? ?start.ts <- tsi[1]
> ? ?end.ts
> <- tsi[2]
> ?} else {
> ? ?start.ts <- tw[1]
> ? ?end.ts
> <- tw[2]
> ?}
> ?freq <- tsi[3]
> ?dt <- 1/freq
>
> n.exo <- 0
> ?ex <- 0
> ?n.ex <- rep(0,N+1)
>
>
>
>
>
>
>
>
> ? ? ? ?[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Steve Lianoglou
Graduate Student: Computational Systems Biology
| Memorial Sloan-Kettering Cancer Center
| Weill Medical College of Cornell University
Contact Info: http://cbio.mskcc.org/~lianos/contact