[scilab-Users] Write selected GROCER 'cadf' output to CSV file

Eric Dubois grocer.toolbox at gmail.com
Sun Apr 8 10:54:40 CEST 2012


Hi

A solution is to create an empty matrix, for instance mat2exp :

--> mat2exp=[]

and to save each cointegration results into a tlist, as shown:
--> res=cadf(0, 1, (HSBA(:, 5)),(BARC(:, 5)));

to recover the associated cointegration tlist:
--> rcoint=res('cointrel')

and the to add a new coordinate to the matrix mat2exp

-->
mat2exp=[mat2exp;strcat(['HSBA','BARC',string(rcoint('rbar')),string(res('tstat')(1)<res('5%
level'))],';')]

When all estimations are done then run:

--> mputl(mat2exp,'coint_results.csv')

Of course, the few commands above can be collected into a function...

Éric.

N.B:
1) this was not so easy, because what you need has to be extracted from the
results tlist (see the text of Grocer function prtunitr to have some
undersatnding of the way to extract these results or other that could
interest you)
2) Instead of true/false, I have used the Scilab conventions for booleans
T/F: it would be easy to transform T/F into True/false


2012/4/5 lw87634 <mikecaple at uk2.net>

> Hi,
>
> I am new to Scilab so apologies if this is a silly question. I am trying to
> write selected output from the GROCER cadf function to a csv file that can
> then be used to analyse the output from multiple comparisons. I know I can
> use the diary function to store the output that's sent to the console but
> this will generate a large file for me so if there's any way to write
> directly to CSV this would be a lot cleaner.
>
> Please see example below showing what I'd like to achieve.
>
> Command I am running:
> res=cadf(0, 1, (HSBA(:, 5)),(BARC(:, 5)));
> (I would in fact execute the above command for multiple pairs of historical
> shareprices)
>
> Edited console output:
> R2 = 0.8274205  adjusted R2 =0.8271161
> ....
> conclusion: the null hypothesis of no cointegration is      accepted at a
> 1%
> level, but rejected at a 5% level
>
> What I would like to achieve is a file containting selected components of
> the above output so that I can see the results from many comparisons in a
> single file (e.g. coint_results.csv):
> Ticker1        Ticker2  Adj R2       Co-int5%
> HSBA                   BARC             0.827                True (or 1)
>
> Thanks in advance for any advice.
>
>
> --
> View this message in context:
> http://mailinglists.scilab.org/Write-selected-GROCER-cadf-output-to-CSV-file-tp3886842p3886842.html
> Sent from the Scilab users - Mailing Lists Archives mailing list archive
> at Nabble.com.
>
> --
> To unsubscribe from this mailing-list, please send an empty mail to
> users-unsubscribe at lists.scilab.org
> To check the archives of this mailing list, see
> http://mailinglists.scilab.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120408/1e1c06be/attachment.htm>


More information about the users mailing list