2024-11-23 13:30:52 by Makoto Fujiwara | Files touched by this commit (2) |
Log message: (math/R-sandwich) Updated 3.0.2 to 3.1.1 # sandwich 3.1-1 * In `meatPL()` the case of cross-section data (i.e., all elements of `order.by` being equal) is handled consistently even if `aggregate = TRUE` (reported by Christof Schoetz). * Fix `bread()` method for `survreg()` objects in case the latter already used a "robust" sandwich variance. In that case `$naive.var` rather than \ `$var` has to be used for the bread (reported by Daniel Klinenberg). * Improve warnings in `vcovHC()` for hat values numerically equal to 1. (Suggested by Sanford Weisberg and John Fox.) # sandwich 3.1-0 * Added jackknife estimator in all `vcovBS()` methods (suggested by Joe Ritter). This is of particular practical interest in linear regression models where the (clustered) jackknife and the (clustered) HC3 (or CV3, without cluster adjustment) estimator coincide. In nonlinear models (including non-Gaussian GLMs) the \ jackknife and the HC3 estimator do not coincide but the jackknife might still be a useful alternative when the HC3 cannot be computed. * Added a new convenience interface `vcovJK()` for the jackknife covariance whose default method simply calls `vcovBS(..., type = "jackknife")` (also \ suggested by Joe Ritter, for more details see the previous item). * Added fractional-random-weight bootstrap, also known as Bayesian bootstrap, in all `vcovBS()` methods (suggested by Noah Greifer and Grant McDermott). This is an alternative to the classical xy bootstrap which has the computational advantage that all observations are always part of the bootstrap samples with positive weights drawn from a Dirichlet distribution. As weights can become close to zero but no observations are excluded completely, this can stabilize the computation of models that are not well-defined on all subsets. * Support weights, offsets, and different fitting methods in `lm` and `glm` objects in the respective `vcovBS()` methods (reported by Noah Greifer). * More verbose error messages in `bwAndrews()` and `bwNeweyWest()` when bandwidth cannot be computed, e.g., due to singular regressor variables (suggested by Andrei V. Kostyrka). * Fix `bread()` method for `coxph()` objects in case the latter already used a "robust" sandwich variance. In that case `$naive.var` rather than \ `$var` has to be used for the bread (reported by Alec Todd). * Fix `plm::plm(..., index = ...)` calls which incorrectly used `indexes = ...` (as in `plm.data()`, reported by Kevin Tappe). |
2023-06-08 18:04:37 by Makoto Fujiwara | Files touched by this commit (2) |
Log message: (math/R-sandwich) Updated 3.0.1 to 3.0.2 # sandwich 3.0-2 * Added new argument `aggregate = TRUE` to `meatPL()` which is thus inherited by `vcovPL()`. By default, this still yields the Driscoll & Kraay (1998) \ covariance matrix. When setting `aggregate = FALSE` the cross-sectional and cross-serial correlation is set to zero, yielding the "pure" panel Newey-West \ covariance matrix. * Bug fix in `vcovCL(..., type = "HC2")` for `glm` objects or `lm` objects with weights. The code had erroneously assumed that the hat matrices were all symmetric (as in the `lm` case without weights). This is corrected now. (Detected and reported by Bixi Zhang.) * Issue a warning in `vcovHC()` for HC2/HC3/HC4/HC4m/HC5 if any of the hat values are numerically equal to 1. This leads to numerically unstable covariances, in the most extreme case `NaN` because the associated residuals are equal to 0 and divided by 0. (Suggested by Ding Peng and John Fox.) * Speed improvement in `vcovBS.lm()`: For `"xy"` bootstrap, \ `.lm.fit()` rather than `lm.fit()` is used which is somewhat more efficient in some situations (suggested by Grant McDermott). For `"residual"` and wild bootstrap, the \ bootstrap by default still samples coefficients via QR decomposition in each iteration (`qrjoint = \ FALSE`) but may alternatively sample the dependent variable and then apply the QR decomposition jointly only once (`qrjoint = TRUE`). If the sample size (and the number of coefficients) is large, then `qrjoint = TRUE` may be significantly faster while requiring much more memory (proposed by Alexander Fischer). * Enable passing score matrix (as computed by `estfun()`) directly to `bwAndrews()` and `bwNeweyWest()`. If this is used, the score matrix should either have a column `(Intercept)` or the `weights` argument should be set appropriately to identify the column pertaining to the intercept (if any). * The vignettes have been tweaked so that they still "run" without \ technical errors when suggested packages (listed in the VignetteDepends) are not available. This is achieved by defining replacement functions that do not fail but lead to partially non-sensical output. A warning is added in the vignettes if any of the replacements is used. |
2021-10-26 12:56:13 by Nia Alarie | Files touched by this commit (458) |
Log message: math: Replace RMD160 checksums with BLAKE2s checksums All checksums have been double-checked against existing RMD160 and SHA512 hashes |
2021-10-07 16:28:36 by Nia Alarie | Files touched by this commit (458) |
Log message: math: Remove SHA1 hashes for distfiles |
2021-09-18 13:43:01 by Makoto Fujiwara | Files touched by this commit (2) |
Log message: (math/R-sandwich) Updated 2.5.1 to 3.0.1 # sandwich 3.0-1 * Extended the "Getting started" page with information on how to use \ _sandwich_ in combination with the _modelsummary_ package (Arel-Bundock) based on _broom_ infrastructure (Robinson, Hayes, Couch). (Based on ideas from Grant McDermott.) <https://sandwich.R-Forge.R-project.org/articles/sandwich.html> * Catch `NA` observations in `cluster` and/or `order.by` indexes for `vcovCL()`, `vcovBS()`, `vcovPL()`, and `vcovPC()`. Such missing observations cannot be handled in the covariance extractor functions but need to be addressed prior to fitting the model object, either by omitting these observations or by imputing the missing values. (Raised by Alexander Fischer on StackOverflow \ <https://stackoverflow.com/questions/64849935/clustered-standard-errors-and-missing-values>.) * In `vcovHC()` if there are `estfun()` rows that are all zero and `type = \ "const"`, then the working residuals for `lm` and `glm` objects are obtained via `residuals()` rather than `estfun()`. (Prompted by an issue raised by Alex Torgovitsky.) # sandwich 3.0-0 * Release of version 3.0-0 accompanying the publication of the paper "Various Versatile Variances: An Object-Oriented Implementation of Clustered Covariances in R." together with Susanne Koell and Nathaniel Graham in the _Journal of Statistcal Software_ at \ <https://doi.org/10.18637/jss.v095.i01>. The paper is also provided as a vignette in the package as `vignette("sandwich-CL", package = "sandwich")`. * Improved or clarified notation in Equations 6, 9, 21, and 22 (based on feedback from Bettina Gruen). * The documentation of the HC1 bias correction for clustered covariances in `vignette("sandwich-CL", package = "sandwich")` has \ been corrected (Equation 15). While both the code in `vcovCL()` and the corresponding documentation `?vcovCL` always correctly used (n-1)/(n-k), the vignette had incorrectly stated it as n/(n-k). (Reported by Yves Croissant.) * The package is also accompanied by a `pkgdown` website on R-Forge now: <https://sandwich.R-Forge.R-project.org/> This essentially uses the previous content of the package (documentation, vignettes, NEWS) and just formatting was enhanced. But a few new features were also added: - A "Get started" vignette for the `pkgdown` page (but not shipped in the package) providing an introduction to the package and listing all variance-covariance functions provided with links to further details. - R/Markdown overview vignettes for the `pkgdown` page (but also not shipped in the package) linking the `Sweave`-based PDF vignettes so that they are easily accessible online. - A `README` with very brief overview for the `pkgdown` title page. - A nice logo, kindly provided by Reto Stauffer. * All kernel weights functions in `kweights()` are made symmetric around zero now (suggested by Christoph Hanck). The quadratic spectral kernal is approximated by `exp(-c * x^2)` rather than `1` for very small `x`. * In case the `Formula` namespace is loaded, warnings are suppressed now for processing formula specifications like `cluster = ~ id` in `expand.model.frame()`. Otherwise warnings may occur with the `|` separator in multi-part formulas with factors. (Reported by David Hugh-Jones.) * The `bread()` method for `mlm` objects has been improved to also handle _weighted_ `mlm` objects. (Suggested by James Pustejovsky.) |
2019-08-08 21:53:58 by Brook Milligan | Files touched by this commit (189) | |
Log message: Update all R packages to canonical form. The canonical form [1] of an R package Makefile includes the following: - The first stanza includes R_PKGNAME, R_PKGVER, PKGREVISION (as needed), and CATEGORIES. - HOMEPAGE is not present but defined in math/R/Makefile.extension to refer to the CRAN web page describing the package. Other relevant web pages are often linked from there via the URL field. This updates all current R packages to this form, which will make regular updates _much_ easier, especially using pkgtools/R2pkg. [1] http://mail-index.netbsd.org/tech-pkg/2019/08/02/msg021711.html |