On Thu, 25 Feb 2010, Artur T. wrote:
Allin Cottrell schrieb:
> 1) In Octave, ensure that the "specfun" and "signal" packages
are
> installed [...]
>
> 2) Get Mario Forni's code [...]
>
> 3) Sample gretl script:
>
> <script>
> open data9-7
> matrix xy = { PRIME, UNEMP }
> mwrite(xy, "(a)dotdir/xy.mat")
>
> foreign language=octave
> xy = gretl_loadmat("xy.mat");
> x = xy(:,1);
> y = xy(:,2);
> # the last param is the Bartlett window size
> h = coher(x, y, 8);
> gretl_export(h, "h.mat");
> end foreign
>
> h = mread("(a)dotdir/h.mat")
> colnames(h, "coherence")
> gnuplot 1 --time --with-lines --matrix=h --output=display
> </script>
Hey Allin, I just compiled the new cvs, installed the octave
packages
via synaptic on my ubuntu system and ran the script. I get the following
error message:
"octave exited with status 256error: `coher' undefined near line 6 column 5
error: evaluating assignment expression near line 6, column 3
error: near line 6 of file `/home/artur/.gretl/gretltmp.m'"
Any ideas what the problem is??
Thanks for testing, Artur. The problem is that the Forni *.m files
are not found, because they're not in Octave's "load path". When I
tested I launched gretl from the directory containing those files.
But an alternative is to add a line like the following into the
"foreign" block, before calling the "coher" function:
addpath("~/stats/octave/forni");
(using the path that's relevant on your system).
Allin.