[R] fSeries - Ox - ver: 240.10068 - Steps to make it work

Ian Gregory ian at iangregory.com
Sun Jun 17 01:40:46 CEST 2007


I received your error now:

In the function .garchOxFit the following line:
write(x, file = "OxSeries.csv", ncolumns = 1, append = TRUE)

should be changed to:
write(x = series, file = "OxSeries.csv", ncolumns = 1, append = TRUE)

(See below for how to reproduce this error - and identify the fix).

--------------------------
Starting a fresh session of R-Project and typing:

library(fSeries)
rm(x)
ianSeries = dem2gbp[, 1]
garchOxFit(~garch(1,1),ianSeries)

Gives the error:

-------------
Error in cat(x, file = file, sep = c(rep.int(sep, ncolumns - 1), "\n"),  :
 object "x" not found
---------------

The variable x is recognised in function: garchOxFit but not:  .garchOxFit 
and not the function: .cat.

doing this shows why:

---------------
options(error=recover)
debug( .garchOxFit)
debug(write)
---------------

The inputs for:  .garchOxFit

.garchOxFit(formula.mean, formula.var, series = x, cond.dist,
    include.mean, trace, control, title, description)

NOTE:  The data is now represented by the variable:  series and the variable
x does not exist.
To write the data to the file: OxSeries.csv.  The data variable (series) 
needs to be
passed to the write function.

This line:
 write(x, file = "OxSeries.csv", ncolumns = 1, append = TRUE)

should be changed to:
write(x = series, file = "OxSeries.csv", ncolumns = 1, append = TRUE)


regards,


Ian.


----- Original Message ----- 
From: "Martin Becker" <martin.becker at mx.uni-saarland.de>
To: "Ian Gregory" <ian at iangregory.com>
Cc: <r-help at stat.math.ethz.ch>; <wuertz at itp.phys.ethz.ch>
Sent: Saturday, June 16, 2007 9:54 PM
Subject: Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work


> Line number 55 in the original mail from 2005 was a reference to 
> garchOxFit (not .garchOxFit) in fSeries version 220.10063 (not 240.10068), 
> as mentioned in 
> https://stat.ethz.ch/pipermail/r-sig-finance/2005q4/000498.html . Of 
> course, in the current version of .garchOxFit, the line number has 
> changed, but the line should still be there, and if .garchOxFit has less 
> than 55 lines, it should be easy to find.
> Does your example still work, if you don't have a variable 'x' visible to 
> garchOxFit (in your environment/search path)? I suppose garchOxFit just 
> uses the series stored in 'x' (in your current workspace) instead of 
> 'IanSeries' (which is even worse than aborting...).
>
> Regards,
>
>  Martin
>
>
> Ian Gregory schrieb:
>> I tried the following and it works for me (after the changes to make):
>>
>> library(fSeries)
>> data(dem2gbp)
>> IanSeries = dem2gbp[, 1]
>> garchOxFit(~garch(1,1),IanSeries)
>>
>> Any writing of data is performed in the GarchOxModelling.ox file.
>> The number of lines of code in the function .garchOxFit() does not appear
>> to go up to 55.  When using:  edit(garchOxFit).
>>
>> I get for the output from the estimation to be:
>>
>> .......
>> .......
>> Estimated Parameters Vector :
>> -0.006183; 0.010761; 0.153406; 0.805877
>>
>>
>> regards,
>>
>> Ian.
>>
>>
>> ----- Original Message ----- From: "Martin Becker" 
>> <martin.becker at mx.uni-saarland.de>
>> To: "Ian Gregory" <ian at iangregory.com>
>> Cc: <r-help at stat.math.ethz.ch>; <wuertz at itp.phys.ethz.ch>
>> Sent: Saturday, June 16, 2007 8:31 PM
>> Subject: Re: [R] fSeries - Ox - ver: 240.10068 - Steps to make it work
>>
>>
>>> I think there is still a small bug which I reported some time ago to 
>>> r-sig-finance 
>>> (https://stat.ethz.ch/pipermail/r-sig-finance/2005q4/000498.html) and 
>>> which takes effect if the time series is not stored in the variable 'x':
>>>
>>> The line
>>>
>>>    write(x, file = "OxSeries.csv", ncolumns = 1, append = TRUE)
>>>
>>> in .garchOxFit() (fSeries version 240.10068) should read
>>>
>>>    write(x = series, file = "OxSeries.csv", ncolumns = 1, append = TRUE)
>>>
>>> instead.
>>>
>>> Incorporating the changes for OX-G at RCH4.2 could be a good occasion to 
>>> fix this as well :-)
>>>
>>> Regards,
>>>
>>>  Martin
>>>
>>>
>>> Ian Gregory wrote:
>>>> -Bugs and fixes reported to Diethelm Wuertz.
>>>> -In the interim.  To make the Ox functions part of the fSeries package 
>>>> work please follow the following steps.
>>>>
>>>>
>>> [snip]
>>>
>>>
>



More information about the R-help mailing list