[R-SIG-Finance] NAs for GARCH

Rich Ghazarian rich7804 at yahoo.com
Tue Mar 13 02:42:22 CET 2007


Here is what my data looks like, after I try to remove the NAs, but I still get an error message for GARCH, any suggestion as to how I can index this.  The data is irregular daily returns, and I would like to fit a GARCH type model, but I am not sure how to apply zooreg or ts 

The raw data in CSV format


 
 
  2/5/2001
  0.29
 
 
  2/6/2001
  0.35
 
 
  2/7/2001
  0.31
 
 
  2/8/2001
  0.26
 
 
  2/9/2001
  0.26
 
 
  2/12/2001
  0.36
 
 
  2/13/2001
  0.43
 
 
  2/14/2001
  0.47
 
 
  2/15/2001
  0.34
 
 z1 <- read.zoo("pp.csv", sep = " ", format = "%m/%d/%y")

and apply

> na.locf(z1)

Time Series:

Start = 11358 

End = 13426 

Frequency = 1 

   [1]  0.291  0.354
 0.310  0.262  0.261  0.261  0.261  0.355
 0.427  0.473  0.340

  [12]  0.158  0.158
 0.158  0.158  0.021  0.032 -0.103 -0.103 -0.103 -0.103
-0.103

  [23] -0.208 -0.165  0.021
-0.078 -0.078 -0.078 -0.035 -0.020  0.065  0.065 -0.022

  [34] -0.022 -0.022 -0.024 -0.127
-0.127  0.000  0.152  0.152  0.152  0.464  0.392

  [45]  0.237  0.178
 0.069  0.069  0.069 -0.053  0.041  0.099  0.111
 0.157  0.157

  [56]  0.157  0.390
 0.397  0.172  0.179  0.068  0.068  0.068
 0.151  0.318  0.396

  [67]  0.452  0.452
 0.452  0.452  0.307  0.157  0.102 -0.120 -0.074
-0.074 -0.074

  [78]  0.069  0.028
 0.043  0.206  0.199  0.199  0.199  0.141
 0.066  0.085 -0.028

  [89] -0.053 -0.053 -0.053  0.068
 0.094  0.130  0.084 -0.050 -0.050 -0.050 -0.129

<!--
D(["mb"," [100] -0.147 -0.113  0.087\n 0.050  0.050  0.050  0.120  0.104  0.104\n-0.051 -0.148\u003c/font\>\n\u003cbr\>\n\u003cbr\>\u003cfont size\u003d\"2\" face\u003d\"sans-serif\"\>&gt; garch(z1, order \u003d c(1, 1), coef\n\u003d NULL, itmax \u003d 200, eps \u003d NULL,grad \u003d c(&quot;analytical&quot;,&quot;numerical&quot;),\nseries \u003d NULL, trace \u003d TRUE)\u003c/font\>\n\u003cbr\>\u003cfont size\u003d\"2\" face\u003d\"sans-serif\"\>Error in garch(z1, order \u003d c(1, 1),\ncoef \u003d NULL, itmax \u003d 200, eps \u003d NULL,  : \u003c/font\>\n\u003cbr\>\u003cfont size\u003d\"2\" face\u003d\"sans-serif\"\>        NAs in x\u003c/font\>\n\u003cbr\>\n--\u003d_alternative 007F353B8825729C_\u003d--",0]
);
D(["ma",[1,"\u003ctable class\u003datt cellspacing\u003d0 cellpadding\u003d5 border\u003d0\>\u003ctr\>\u003ctd colspan\u003d2\>\u003cb style\u003dpadding-left:3\>2 attachments\u003c/b\> &#8212; Scanning for viruses...\u003ctr\>\u003ctd\>\u003ctable cellspacing\u003d0 cellpadding\u003d0\>\u003ctr\>\u003ctd\>\u003cimg width\u003d16 height\u003d16 src\u003d\"/mail/images/generic.gif\"\>\u003ctd width\u003d7\>\u003ctd\>\u003cb\>gas.csv\u003c/b\>\u003cbr\>30K \u003c/table\>\u003ctr\>\u003ctd\>\u003ctable cellspacing\u003d0 cellpadding\u003d0\>\u003ctr\>\u003ctd\>\u003cimg width\u003d16 height\u003d16 src\u003d\"/mail/images/generic.gif\"\>\u003ctd width\u003d7\>\u003ctd\>\u003cb\>pp.csv\u003c/b\>\u003cbr\>23K \u003c/table\>\u003c/table\>","1114869f291fd79d"]
]
);

//--> [100] -0.147 -0.113  0.087
 0.050  0.050  0.050  0.120  0.104  0.104
-0.051 -0.148



> garch(z1, order = c(1, 1), coef
= NULL, itmax = 200, eps = NULL,grad = c("analytical","numerical"),
series = NULL, trace = TRUE)

Error in garch(z1, order = c(1, 1),
coef = NULL, itmax = 200, eps = NULL,  : 

        NAs in x






--=_alternative 007F353B8825729C_=--

----- Original Message ----
From: "r-sig-finance-request at stat.math.ethz.ch" <r-sig-finance-request at stat.math.ethz.ch>
To: r-sig-finance at stat.math.ethz.ch
Sent: Monday, March 12, 2007 4:00:05 AM
Subject: R-SIG-Finance Digest, Vol 34, Issue 7

Send R-SIG-Finance mailing list submissions to
    r-sig-finance at stat.math.ethz.ch

To subscribe or unsubscribe via the World Wide Web, visit
    https://stat.ethz.ch/mailman/listinfo/r-sig-finance
or, via email, send a message with subject or body 'help' to
    r-sig-finance-request at stat.math.ethz.ch

You can reach the person managing the list at
    r-sig-finance-owner at stat.math.ethz.ch

When replying, please edit your Subject line so it is more specific
than "Re: Contents of R-SIG-Finance digest..."


Today's Topics:

   1. Re: Error in read.zoo (Achim Zeileis)


----------------------------------------------------------------------

Message: 1
Date: Sun, 11 Mar 2007 12:24:26 +0100 (CET)
From: Achim Zeileis <Achim.Zeileis at wu-wien.ac.at>
Subject: Re: [R-SIG-Finance] Error in read.zoo

Cc: r-sig-finance at stat.math.ethz.ch
Message-ID: <Pine.LNX.4.64.0703111221430.17202 at eowyn>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Sat, 10 Mar 2007, Rich Ghazarian wrote:

> I get the following error and don't know how to get around this?
>
> z <- read.zoo("pp.csv", sep = " ", format = "%m/%d-%y")
> Error in read.zoo("pp.csv", sep = " ", format = "%m/%d-%y") :
>        index contains NAs
>
> My Data looks like this
>
>
>

Does this mean that there is no data? ;-)
More seriously, we would need an example to say anything useful.
Z

>
> ____________________________________________________________________________________
> Bored stiff? Loosen up...
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
>



------------------------------

_______________________________________________
R-SIG-Finance mailing list
R-SIG-Finance at stat.math.ethz.ch
https://stat.ethz.ch/mailman/listinfo/r-sig-finance


End of R-SIG-Finance Digest, Vol 34, Issue 7
********************************************





 
____________________________________________________________________________________
Be a PS3 game guru.



More information about the R-SIG-Finance mailing list