项目作者: bonStats

项目描述 :
General Constraint Regression Models
高级语言: R
项目地址: git://github.com/bonStats/gcreg.git
创建时间: 2016-09-24T05:59:14Z
项目社区:https://github.com/bonStats/gcreg

开源协议:Other

下载


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:

  1. devtools::install_github("bonStats/gcreg")
  2. library(gcreg)

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

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

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

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

See the package vignettes for more examples: