cirls

Constrained Iteratively Reweighted Least Squares

https://github.com/pierremasselot/cirls

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.5%) to scientific vocabulary

Keywords

package
Last synced: 9 months ago · JSON representation

Repository

Constrained Iteratively Reweighted Least Squares

Basic Info
  • Host: GitHub
  • Owner: PierreMasselot
  • Language: R
  • Default Branch: main
  • Homepage:
  • Size: 266 KB
Statistics
  • Stars: 0
  • Watchers: 2
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Topics
package
Created almost 5 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog

README.md

Constrained Iteratively Reweighted Least Squares

<!-- badges: end -->

The package cirls provides routines to fit Generalized Linear Models (GLM) with coefficients subject to linear constraints, through a constrained iteratively reweighted least-squares algorithm.

Installation

The easiest way to install the cirls package is to install it from CRAN

```R

install.packages("cirls")

```

The development version can be installed from GitHub using the devtools package as

R devtools::install_github("PierreMasselot/cirls")

Please check the file NEWS.md for changes in the development version compared to the CRAN one.

Usage

The central function of the package is cirls.fit meant to be passed through the method argument of the glm function. The user is also expected to pass a either constraint matrix or a list of constraint matrices through the Cmat argument, and optionally lower and upper bound vectors lb and ub.

The package also contains dedicated methods to extract the variance-covariance matrix of the coefficients vcov. cirls as well as confidence intervals confint.cirls.

The example below show how to use the package to perform nonnegative regression. See ?cirls.fit for more comprehensive examples.

```R

Simulate predictors and response with some negative coefficients

set.seed(111) n <- 100 p <- 10 betas <- rep_len(c(1, -1), p) x <- matrix(rnorm(n * p), nrow = n) y <- x %*% betas + rnorm(n)

Define constraint matrix

Cmat <- diag(p)

Fit GLM by CIRLS

res <- glm(y ~ x, method = cirls.fit, Cmat = list(x = Cmat)) coef(res)

Obtain vcov and confidence intervals

vcov(res) confint(res) ```

References

To come

Owner

  • Name: Pierre Masselot
  • Login: PierreMasselot
  • Kind: user
  • Location: London, United Kingdom
  • Company: LSHTM

GitHub Events

Total
  • Push event: 14
  • Pull request event: 1
Last Year
  • Push event: 14
  • Pull request event: 1

Packages

  • Total packages: 1
  • Total downloads:
    • cran 178 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: cirls

Constrained Iteratively Reweighted Least Squares

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 178 Last month
Rankings
Dependent packages count: 28.2%
Dependent repos count: 34.8%
Average: 49.9%
Downloads: 86.7%
Maintainers (1)
Last synced: 10 months ago

Dependencies

DESCRIPTION cran
  • TruncatedNormal * imports
  • coneproj * imports
  • osqp * imports
  • quadprog * imports
  • stats * imports
  • testthat >= 3.0.0 suggests