curvPol: Evaluating the Curvature of Polynomials

Description Usage Arguments Value Author(s) Examples

View source: R/util.R

Description

Function to evaluate the curvature of polynomials

Usage

1

Arguments

x

numerical values at which to evaluate the curvature of polynomials, can be provided in a vector, matrix, array or data frame

beta

numerical vector containing the coefficient of the polynomial

Value

The result of evaluating the curvature of the polynomial at the values in x, returned in the same dimension as x has.

Author(s)

Berwin A Turlach <Berwin.Turlach@gmail.com>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
beta <- c(1,2,1)

x <- 0:10
curvPol(x, beta)
str(curvPol(x, beta))

x <- cbind(0:10, 10:0)
curvPol(x, beta)
str(curvPol(x, beta))


x <- data.frame(x=0:10, y=10:0)
curvPol(x, beta)
str(curvPol(x, beta))

Example output

Loading required package: quadprog
 [1] 0.1788854382 0.0285336029 0.0088864317 0.0038164534 0.0019703707
 [6] 0.0011454549 0.0007233203 0.0004854341 0.0003413540 0.0002490654
[11] 0.0001872481
 num [1:11] 0.17889 0.02853 0.00889 0.00382 0.00197 ...
              [,1]         [,2]
 [1,] 0.1788854382 0.0001872481
 [2,] 0.0285336029 0.0002490654
 [3,] 0.0088864317 0.0003413540
 [4,] 0.0038164534 0.0004854341
 [5,] 0.0019703707 0.0007233203
 [6,] 0.0011454549 0.0011454549
 [7,] 0.0007233203 0.0019703707
 [8,] 0.0004854341 0.0038164534
 [9,] 0.0003413540 0.0088864317
[10,] 0.0002490654 0.0285336029
[11,] 0.0001872481 0.1788854382
 num [1:11, 1:2] 0.17889 0.02853 0.00889 0.00382 0.00197 ...
              x            y
1  0.1788854382 0.0001872481
2  0.0285336029 0.0002490654
3  0.0088864317 0.0003413540
4  0.0038164534 0.0004854341
5  0.0019703707 0.0007233203
6  0.0011454549 0.0011454549
7  0.0007233203 0.0019703707
8  0.0004854341 0.0038164534
9  0.0003413540 0.0088864317
10 0.0002490654 0.0285336029
11 0.0001872481 0.1788854382
'data.frame':	11 obs. of  2 variables:
 $ x: num  0.17889 0.02853 0.00889 0.00382 0.00197 ...
 $ y: num  0.000187 0.000249 0.000341 0.000485 0.000723 ...

MonoPoly documentation built on May 2, 2019, 7:59 a.m.

Related to curvPol in MonoPoly...