OZrain                 package:VLMC                 R Documentation

_D_a_i_l_y _R_a_i_n_f_a_l_l _i_n _M_e_l_b_o_u_r_n_e, _A_u_s_t_r_a_l_i_a, _1_9_8_1-_1_9_9_0

_D_e_s_c_r_i_p_t_i_o_n:

     Amount of daily rainfall in Melbourne, Australia, 1981-1990,
     measured in millimeters.  The amounts are integers with many zeros
     and three days of more than 500mm rain.

_U_s_a_g_e:

     data(OZrain)

_F_o_r_m_a_t:

     A time-series of length 3653 with the amount of daily rainfall in
     mm. Because of the two leap years 1984 and '88, we have
     constructed it with 'ts(*, start=1981, frequency=365.25, end =
     1981+ (3653 - 1)/365.25)'.

_N_o_t_e:

     There must be one extra observation since for the ten years with
     two leap years, there are only 3652 days. In 61 out of 100 days,
     there's no rain.

_S_o_u_r_c_e:

     'rainfall.dat' in Rob J. Hyndman's _Time Series Data Library_,
     <URL: http://www-personal.buseco.monash.edu.au/~hyndman/TSDL/>

     originally, Australian Bureau of Meteorology, <URL:
     http://www.abs.gov.au>.

_E_x_a_m_p_l_e_s:

     data(OZrain)
     (n <- length(OZrain)) ## should be 1 more than
     ISOdate(1990,12,31) - ISOdate(1981, 1,1)## but it's 2 ..

     has.rain <- OZrain > 0

     summary(OZrain[has.rain])# Median = 18,  Q3 = 50
     table(rain01 <- as.integer(has.rain))
     table(rain4c <- cut(OZrain, c(-.1, 0.5, 18.5, 50.1, 1000)))



     AIC(v1  <- vlmc(rain01))# cutoff = 1.92
     AIC(v00 <- vlmc(rain01, cut = 1.4))
     AIC(v0  <- vlmc(rain01, cut = 1.5))



     hist(OZrain)
     hist(OZrain, breaks = c(0,1,5,10,50,1000), xlim = c(0,100))

     plot(OZrain, main = "Rainfall 1981-1990 in Melbourne")
     ## work around bug in plot.ts() for R <= 1.3.1 :
     newer1.4 <- {v <- R.version; v$major > 1 || as.numeric(v$minor) >= 4.2}
     if(newer1.4) {
       plot(OZrain, log="y", main = "Non-0 Rainfall [LOG scale]")
     } else
       plot.ts(time(OZrain)[has.rain],
               OZrain[has.rain], log="y", main = "Non-0 Rainfall [LOG scale]")
     lOZ <- lowess(log10(OZrain[has.rain]), f= .05)
     lines(time(OZrain)[has.rain], 10^lOZ$y, col = 2, lwd = 2)

