Last data update: 2014.03.03

R: Check whether a polynomial is monotone
ismonotoneR Documentation

Check whether a polynomial is monotone

Description

Function to check whether a polynomial is montone over a given interval.

Usage

ismonotone(object, ...)

## S3 method for class 'monpol'
ismonotone(object, a = -Inf, b = Inf, EPS = 1e-06, ...)

## Default S3 method:
ismonotone(object, a = -Inf, b = Inf, EPS = 1e-06, ...)

Arguments

object

Either an object of class ‘

monpol

or a numeric vector containing the coefficient of the polynomial.

a

Lower limit of the interval over which the polynomial should be montone.

b

Upper limit of the interval over which the polynomial should be montone.

EPS

Numerical precision, values with absolute value smaller than EPS are treated as zero.

...

Further arguments passed to or from other methods.

Value

TRUE or FALSE depending on whether the polynomial is montone over (a,b) or not.

Note that due to numerical precision issues it is possible that a polynomial that should be monotone is declared to be not monotone.

Author(s)

Kevin Murray and Berwin A Turlach

Examples

  fit <- monpol(y~x, w0)
  ismonotone(fit)

  beta <- c(1,0,2)  ## the polynomial 1 + 2*x^2
  ismonotone(beta)
  ismonotone(beta, a=0)
  ismonotone(beta, b=0)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(MonoPoly)
Loading required package: quadprog
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/MonoPoly/ismonotone.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ismonotone
> ### Title: Check whether a polynomial is monotone
> ### Aliases: ismonotone ismonotone.monpol ismonotone.default
> ### Keywords: utitlities
> 
> ### ** Examples
> 
>   fit <- monpol(y~x, w0)
>   ismonotone(fit)
[1] TRUE
> 
>   beta <- c(1,0,2)  ## the polynomial 1 + 2*x^2
>   ismonotone(beta)
[1] FALSE
>   ismonotone(beta, a=0)
[1] TRUE
>   ismonotone(beta, b=0)
[1] TRUE
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>