Hi,

I can not get the desired result if I running the example code from QRMlib
user manual:

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

data(nasdaq);
> nreturns <- -mk.returns(nasdaq);
> monthly.maxima <- aggregateMonthlySeries(nreturns,FUN=max);
Error in aggregateMonthlySeries(nreturns, FUN = max) :
  no slot of name "Dim" for this object of class "timeDate"
> monthly.maxima <- seriesData(monthly.maxima)
Error in seriesData(monthly.maxima) : object "monthly.maxima" not found
> mod1 <- fit.GEV(monthly.maxima);
Error in var(maxima) : object "monthly.maxima" not found

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

The following content is the prompt message after I running debug
(ggregateMonthlySeries)

----------------------------------------------
> monthly.maxima <- aggregateMonthlySeries(nreturns,FUN=max);
debugging in: aggregateMonthlySeries(nreturns, FUN = max)
debug: {
  if (!is.timeSeries(timeseries))
  stop("timeseries must be of the timeSeries class from fCalendar package")
  charvecStartDate <- timeseries@positions[1]
  charvecLastDate <- timeseries@positions[length(timeseries@positions)]
  dateFormat = "%Y-%m-%d"
  test1 <- as.character(timeFirstDayInMonth(charvecStartDate))
  test2 <- as.character(timeFirstDayInMonth(charvecLastDate))
  from3 = timeSequence(from = test1, to = test2, by = "month",
  format = dateFormat)
  test3 <- as.character(timeLastDayInMonth(charvecStartDate))
  test4 <- as.character(timeLastDayInMonth(charvecLastDate))
  to3 = timeSequence(from = test3, to = test4, by = "month",
  format = dateFormat)
  monthsLength <- to3@Dim
  repetitions <- as.integer(monthsLength/12)
  remainder <- monthsLength - 12 * repetitions
  firstDayInMonthYr <- c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
  monthNumbers <- c(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
  lastMonthDayStdYr <- c(31, 28, 31, 30, 31, 30, 31, 31, 30,
  31, 30, 31)
  lastDayVector <- rep(lastMonthDayStdYr, time = repetitions)
  if (remainder > 0)
  lastDayVector <- c(lastDayVector, lastMonthDayStdYr[1:remainder])
  monthVector <- rep(monthNumbers, times = repetitions)
  if (remainder > 0)
  monthVector <- c(monthVector, monthNumbers[1:remainder])
  ltest <- strptime(to3@Data, "%Y-%m-%d")
  ltest$mday <- lastDayVector
  ltest$mon <- monthVector
  for (iter in 1:monthsLength) {
  if (leap.year(ltest$year[iter] + 1900) && (ltest$mon[iter] ==
  1))
  ltest$mday[iter] <- 29
  }
  to3@Data[] <- ltest
  applySeries(timeseries, from3, to3, by = "monthly", FUN = FUNC)
}
Browse[1]> monthly.maxima <- seriesData(monthly.maxima)
Error in seriesData(monthly.maxima) : object "monthly.maxima" not found
Browse[1]> mod1 <- fit.GEV(monthly.maxima);
------------------------------------------------------

How can we get the desired result?

Appreciate a lot!

Best,

Hong

	[[alternative HTML version deleted]]

