[R] Rolling Window Granger Causality

Jeff Newmiller jdnewmil at dcn.davis.ca.us
Sat Jul 11 22:41:10 CEST 2015


This is a rather broad request. If you are looking for help understanding 
these topics, you should probably ask in a forum where statistical theory 
is on topic (e.g. stats.stackexchange.com), since in this forum you should 
already have a good idea of what algorithms you want to apply and in what 
sequence and be asking about how to get R to do that.  In practically all 
cases you should have some reproducible (including sample data) code that 
illustrates how far you have come, and specific questions about how to 
link the dots. Sample data is crucial.

I also highly recommend reading the vignettes and documentation associated 
with each the packages you plan to use. For example, functions in the 
"zoo" (note that capitalization matters) package can be used to create 
rolling averages, and then those results can be given to functions in 
another package (such as "vars"... note again that capitalization makes a 
difference) to analyze the original data along with the zoo results. 
While there may be experts in both packages you name lurking in this 
forum, often people may only be familiar with one or none of the packages 
you name but they may be able to interpret why something you are trying to 
do is not working if they can reproduce what you have already done. There 
are thousands of different R packages, but not nearly so many active 
helpers on R-help.

Also, you can use the "findFn" function in the "sos" package to search for 
"granger causality" among all available R packages on CRAN and find that 
there are several packages that match, so the "vars" package is not your 
only option.

Try reading [1] to get a feel for how to communicate your problem 
effectively.

[1] http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example

On Sun, 12 Jul 2015, Syed Jawad Hussain Shahzad wrote:

> Dear Sir, Hi
>
> I am new to R and want some help on the subject analysis. I need help
> to apply causality analysis (available in Package 'VARS') with a
> per-define rolling window (like rollapply in Package 'Zoo').
>
> Best Wishes
> Jawad
>
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
>

---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                       Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k



More information about the R-help mailing list