2018-02-07 * added digest to suggests in DESCRIPTION after notification from Hornik: Warning: You used a knitr feature that depends on the digest package. Make sure it is installed. 2017-01-24 * change to the file glarmaPoissonPearson.R. Call in line 125 to log(factorial(Y[time]) changed to lfactorial(y[time]) to avoid overflow. Prompted by email from Hee-Young Kim , December 27, 2016 * changed /glarma/R/forecast.R : 14 if (L == 0) return to if (L == 0) stop("Values are required for predictors") following advice from CRAN on 14/11/2016 * new version 1.5-0 to incorporate changes 2015-09-29 * new version 1.4-0 created as requested by JSS * NAMESPACE changed to add import and importFrom entries required for packages in base R. Also added S3metod for nobs.glarma 2014-09-25 * plot.glarma changed to add four extra plots using randomized residuals. Default plots changed, dropping three of the original plots and adding three randomized residual plots (histogram, Q-Q plot and acf) 2014-09-23 * normRandPIT added to create randomized residuals 2014-09-18 * forecast, forecast.glarmamod added as generic and method for forecasting using objects of class glarmamod 2014-07-31 * glarma.Rd, summary.glarma.Rd to add offset and pq respectively to the components of the lists returned by glarma and summary.glarma. * likTests, summary.glarma, print.summary.glarma, print.glarma changed so that they behave properly if there is no ARMA component. likTests now checks for existence of an ARMA component and returns a 0 statistic and p-value 1 if there is none. print.summary.glarma and print.glarma also check for an ARMA component and only try to print ARMA coefficients if there are some to print. The list returned by summary.glarma had to be changed to include pq so the test could be included in print.summary.glarma. * glarma, likTests, model.frame.glarma changed to include the possibility of an offset. Element offset was added to the list returned by glarma. In likTests a conditional statement added an offset to the base glm if an offset was present in the glarma model. In model.frame.glarma the offset was added to the model frame with the name "(offset)" which is what happens with glm when the offset is specified using a separate argument (but which is different to what occurs with glm if the offset is specified as part of the linear model). 2014-07-25 * *.Rd files changed to add offset argument where needed to agree with modified code. Examples changed in a couple of cases where arguments were assigned by position but position had changed because of addition of offset argument. 2014-07-24 * DriverDeaths.Rd and DriverDeaths.RData created as an example of the use of an offset. 2014-06-09 * glarma.R and summary.glarma.R changed to modify labelling on output of GLARMA parameters. Old labelling "AR parameters" changed to "GLARMA parameters" so as to be applicable for moving average as well as autoregressive or mixed structures. * glarmaBinomialIdentity.R changed to insert missing minus (-) signs in e.d and e.dd as follows: Replace e.d[, tmpq] <- n.trial[time] * pt * (1 - pt) * W.d[, tmpq] by e.d[, tmpq] <- -n.trial[time] * pt * (1 - pt) * W.d[, tmpq] and replace e.dd[, , tmpq] <- n.trial[time] * pt * (1 - pt) * ((1 - 2 * pt) * W.d[, tmpq] %o% W.d[, tmpq] + W.dd[, , tmpq]) by e.dd[, , tmpq] <- -n.trial[time] * pt * (1 - pt) * ((1 - 2 * pt) * W.d[, tmpq] %o% W.d[, tmpq] + W.dd[, , tmpq]) * glarmaBinomialScore.R changed to correct code for e.dd as follows: Replace e.dd[, , tmpq] <- e.dd[, , tmpq] <- (-2 * pt + 1 + pt * e[tmpq] + e[tmpq] * (1 - pt)^2) * W.d[, tmpq] %o% W.d[, tmpq] + (e.d[, tmpq]/W.d[, tmpq]) * W.dd[, , tmpq] by e.dd[, , tmpq] <- (-2*pt + 1 + pt^2*e[tmpq] + e[tmpq]*(1 - pt)^2) * W.d[, tmpq] %o%W.d[, tmpq] + (-1 + pt * e[tmpq] - e[tmpq] * (1 - pt))*W.dd[, , tmpq] * glarma.R changed. Offset added to Poisson, binomial and negative binomial models and to initialization. Changes: glarma <- function(y, X, offset = NULL, type = "Poi", method = "FS", residuals = "Pearson", phiLags, thetaLags, phiInit, thetaInit, beta, alphaInit, alpha = 1, maxit = 30, grad = 2.22e-16) Inside glarma in all relevant places GL <- glarmaPoissonPearson(y, X, offset = offset, delta, phiLags, thetaLags, method = method) * initial.R changed. Argument offset = NULL added to arguments and calls to glm. For example (GLM <- glm(y ~ -1 + X, offset = offset, family = poisson, x = TRUE)) GLMInt <- glm(y ~ X, offset = offset, family = poisson, x = TRUE) * deltaGen.R changed. Argument offset = NULL added to arguments and in call to initial() * glarmaNegBinomial, glarmaNegBinScore, glarmaPoissonPearson, glarmaPoissonScore, glarmaBinomialPearson, glarmaBinomialScore and glarmaBinomialIdentity changed. Argument offset = NULL added. To incorporate offset: eta <- X %*% beta replaced by if(is.null(offset)) eta<-X %*% beta else eta<- X %*% beta + offset * in initial defined an offset to be compatible with glm.nb: offset.nb<-if(is.null(offset)) rep(0,length(y)) else offset (GLM <- glm.nb(y ~ -1 + X + offset(offset.nb), init.theta = alpha, x = TRUE)) GLMInt <- glm.nb(y ~ X + offset(offset.nb), init.theta = alpha, x = TRUE) * data set SvndDeathsUtah.Rdata added for example on using offset term in a Poisson GLARMA model. Code for fitting model is in file UTAH_svn_offset_example.R 2014-01-17 * DESCRIPTION and NAMESPACE altered to make MASS Imports instead of Depends, and to import glm.nb from MASS 2014-01-15 * added vignette .Rnw file and .bib file in vignettes directory and .Rnw and .pdf and .bib in inst/doc, also knitr to suggests, and VignetteBuilder in DESCRIPTION file. Some extra lines needed in the .Rnw file compared to the JSS version, namely \VignetteIndexEntry and \VignetteEngine specification 2013-12-22 * plot.glarma.R has added argument titles, to allow user specification of graph titles. Arguments main = NULL, added to histPIT and qqPIT also to facilitate this * Asthma.Rd negative binomial example changed * likTests x = T changed to x = TRUE throughout * glarma.Rd list of methods ("FS" and "NR") added in description of arguments. Description of beta changed to say it specifies regression coefficients * paramGen.Rd alias paramGen added 2013-12-16 * many small changes to documentation mainly to fix values returned and descriptions. Worked with William at UNSW to complete changes and submit to CRAN 2013-11-18 * summary.glarma, print.summary.glarma, print.glarma all changed to take the null deviance and degrees of freedom found by initial and use it when printing the glarma fit and summary * initial changed so that the GLM with an intercept is also fitted and usual null deviance and null df are extracted from it and returned by initial 2013-11-15 * OxBoatRace.Rd, RobberyConvict.Rd examples changed so that glm model is fitted with an intercept, so null degrees of freedom are number of observations -1 2013-11-14 David * summary.glarma changed to fix problem with degrees of freedom calculation. Previous calculation used length() but this fails for binomial when a matrix is supplied. Changed from using length() to using NROW. * print.glarma also changed to fix degrees of freedom 2013-11-13 * summmary.glarma and print.summmary.glarma argument testings changed to tests * print.summmary.glarma changed to put tests at the end and specify null and alternative hypotheses. 2013-11-12 David * glarma.Rd altered to ensure no examples take more than 5secs which is a CRAN requirement. I set the polio grad values to 1e-6 in glarma, moved the other examples to the data help files (Asthma, OxBoatRace and RobberyConvict). There was still a problem with Asthma, which already had grad values of 1e-6. I cut the Newton-Raphson example, just left Fisher scoring, and put the negative binomial as \dontrun. I put a note on the negative binomial to say it was \dontrun only because of timing for acceptance on CRAN. I also put some pointers to the other examples in \seealso in glarma. 2013-11-11 Ethan * added the null deviance into the glarma object, and it is also into the print method of the glarma object. * added the null deviance and the residual deviance into the print method of the summary.glarma object, they are shown with their degrees of freedom at the bottom of the summary table. 2013-11-03 Ethan * changed the functions for control flow in deltaGen, phiGen and thetaGen. They were originally controlled by is.null(), they are replaced by missing(). The the default settings for arguments phiLags, phiInit, thetaLags, thetaInit, alphaInit and beta in glarma() are no longer NULL, but missing statement due to this change of control flow functions. 2013-11-01 David * fitted.glarma replaced by a standard fitted function. fitted.values added to the list of objects returned by all the glarma fitting functions. Actually fitted.glarma is now redundant---fitted.default could be used as it is by glm and lm. However, I have kept it in. Also mu and fitted.values returned by the fitting functions are exactly the same, so only one is needed, which should be fitted.values, but I have also kept mu. 2013-10-31 David * glarmaPredProb changed for object$type == "Bin". Value of pi was incorrectly calculated. Should be exp(W)/(1 + exp(W)). The accessor function fitted.glarma needs checking, particularly its default values. 2013-10-31 David * qqPIT changed argument from intervals to bins to agree with histPIT. * likeTests defined as a synonym for likTests. 2013-10-30 Ethan * revised glarma.Rd for the explanation of the argument y. * modified mySolve.R. In mySolve(), is.matrix() was originally used to detect the uninvertible matrix, but it actually failed to do so, as the inverse of the uninvertible matrix was still in matrix form; therefore, is.matrix() could not be used to do the control flow. It is now replaced with is.na() to see if there is any number in the matrix that is NA or NaN. * added a warning message into glarma() in glarma.R to help users identify the situation that the model fitting is not able to converge. * added PIT.R, it is the methods of generating PIT for the glarma object. It includes the function glarmaPredProb(), glarmaPIT(), histPIT() and qqPIT(). * added PIT.Rd and plotPIT.Rd, they are the documentations for the PIT methods. * modified plot.glarma() by adding two PIT plots, PIT histogram and uniform Q-Q plot for PIT. The corresponding arugments for controling these two plot have been added into plot.glarma() * revised plot.glarma.Rd for the inclusion the PIT plots. 2013-10-09 David * revised all .Rd files, except plot.glarma.Rd which requires the addition of PIT plots. 2013-10-07 David * likeTests changed to likTests for consistency with logLik. See also the use of print.likTests below. Also some minor changes to print methods (adding "\n" in some places). 2013-09-10 David * RUnit testing capability added. Involves adding directories tests, inst, and inst/unitTests. The approach used is the one described on the R-Wiki: http://rwiki.sciviews.org/doku.php?id=developers:runit 2013-08-30 Ethan * print.likTests.R added. It is the print method for likeTests, it would present the tests with P-value as a matrix. Also, it would come up with the significant star to help identify whether the tests are significant. 2013-08-27 David * revised all .Rd files, changed names of data sets to start with upper case letter, renamed all R files to have extension .R 2013-08-18 Ethan * plot.glarma.Rd has been created, the manual about how to use this S3 generic function has been set up. 2013-08-15 Ethan * plot.glarma.R added. It is a S3 generic plot method. 2013-08-07 Ethan * glarma.R changed. The names of the returns for delta, ll, ll.d, ll.dd, e, philags, thetalags, Y, Residtype and ErrCode are changed to coefficients, logLik, logLikDeriv, logLikDeriv2, residuals, phiLags, thetaLags, y, residType and errCode respectively. Also,the returns were originally stored in a two levels list. i.e. glarmaMod$fit$aic. It has been adjusted to one level list. i.e. glarma$aic. * accessors.R added. They are the accessor functions that are used to extract the returns from the glarma object. They are all S3 generic fucntions. File includes functions coef.glarma, fitted.glarma, residuals.glarma, logLik.glarma, nobs.glarma, model.frame.glarma and extractAIC.glarma. * The documentations for the functions in the accessors.R have been created. 2013-07-29 Ethan * cleaned up all .R file, and make them all into google style. * paramGeneration.R added. They are the functions that are used to create the vector of initial theta, phi and delta automatically. File includes functions thetaGen, phiGen and deltaGen. * paramGeneration.Rd created. * glarma.R changed and arguments phiInit, thetaInit, beta, alpha.init and alpha are added. Functions in paramGeneration.R are added into the function "glarma". The users would not need to create the initial vector theta, phi and delta by themselves right now, they could just put the neccessary information into the glarma function, the delta would be created automatically. * summary.glarma.R added. They are the summary method and the print method for summary.glarma. File includes functions summary.glarma and print.summary.glarma.