derivatives: First and Second Derivatives

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Three points first and second derivatives numerical approximation used with the m4plEstimateMore function.

Usage

1
2
3
4
5
 fprime( x, FUN = "FP", h = 0.001, names = paste("x", c(1:length(x)),
 sep = ""))
 fsecond(x, FUN = "FP", h = 0.001, names = paste("x", c(1:length(x)),
 sep = ""))
 

Arguments

x

numeric; vector of values at which the derivation is to be done.

FUN

function; function to derive.

h

numeric; neighbouring value.

names

character; names given to each results. DEFAULT to the existing names of the vector x.

Details

This function could be used for numerical derivation in general, but is dedicated to be used internally by m4plEstimateMore. For other general purposes D, deriv and deriv3 are preferred.

Value

fprime

numeric; vector of first derivatives.

fsecond

numeric; matrix of second derivatives.

Author(s)

Gilles Raiche, Universite du Quebec a Montreal (UQAM),

Departement d'education et pedagogie

Raiche.Gilles@uqam.ca, http://www.er.uqam.ca/nobel/r17165/

References

Press, W. H., Vetterling, W. T., Teukolsky, S. A. and Flannery, B. P. (2002). Numerical recipees in C++. The art of scientific computing, 2nd edition. Cambridge, United Kingdom: Cambridge University press.

Yakowitz, S. and Szidarovszky, F. (1986). An introduction to numerical computations. New York, New Jersey: MacMilla.

See Also

D, deriv and deriv3

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## .....................................
 test  <- function(x) 2*x+5
  test(   x=0)
  fprime( x=0, FUN=test)
  fsecond(x=0, FUN=test)
## .....................................
 test2 <- function(x) 2*(x[1]*x[2])+5
  test2(  x=c(0,0))
  fprime( x=c(0,0), FUN=test2)
  fsecond(x=c(0,0), FUN=test2)
 

irtProb documentation built on May 2, 2019, 1:30 p.m.