Skip to content

bonStats/gcreg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

4fe8513 · Jan 3, 2018

History

99 Commits
Dec 14, 2017
Dec 14, 2017
Sep 4, 2017
Dec 6, 2017
Sep 28, 2016
Oct 19, 2017
Dec 14, 2017
Aug 16, 2017
Dec 14, 2017
Jan 3, 2018
Sep 28, 2016

Repository files navigation

gcreg: General Constraint Regression models in R

This package is currently being developed. It's aim is to provide methods for fitting regression models with:

  • Functional and shape constraints, e.g. monotonicity
  • Parameter inequality constraints
  • Joint constraints, e.g. combinations of the above
  • Other constraints that create closed and convex parameter spaces

The paper accompanying this package is available here.

The current focus of development is on monotonicity in polynomial fixed and mixed effects models but will be extended over time to more general models and constraints.

To get started, install this package from GitHub using the devtools package:

devtools::install_github("bonStats/gcreg")
library(gcreg)

To install with vignettes you will need to install some required packages and set build_vignettes = T:

install.packages(c("rmarkdown","ggplot2","fda"))
devtools::install_github("bonStats/gcreg", build_vignettes = T)
library(gcreg)

You can start fitting constrained polynomial models with the gcreg::cpm() function. For example

library(fda)
data(onechild)
cpm(height~day, data = onechild, degree = 5, constraint = "monotone", c_region = c(1,312))

See the package vignettes for more examples: