Learn R Programming

nlr (version 0.1-3)

curvature: Calculate (IE) Intrinsic curvature and (PE) Parameter curvature.

Description

IE and PE are measures to identify the linear approximation of nonlinear model is appropriate or no. This function may not be called explicitly by user.

Usage

curvature(gradient, hessian, sigma)

Arguments

gradient

n by p gradient of fited model.

hessian

n by p by p array of hessian for the nonlinear model.

sigma

estimated standard deviation.

Value

List of curvature values.

  • pe: Parameter Effect curvature.

  • int: Intrinsic effect curvature.

  • a: A matrix.

  • cutf: cut of point $$1/\sqrt{F(.95,p,n-p)}$$, if PE or IE be biger than cut of point then either of them has larg curvature.

Details

Gauss Newton method of estimation is based on linear approximation to nonlinear model. The linear approximation to function might not be appropriate. PE and IE is used to identify the parameter effect and intrinsic effect of model. Big values represent the linear approximation to nonlinear model is not correct.

References

Bates, D.M., and Watts, D. G. (1980). Relative curvature measures of nonlinearity, J. R. statistic. Ser. B 42: 1-25.

Examples

Run this code
# NOT RUN {
 crbdt<-list(xr=nlr::carbon$year,yr=nlr::carbon$co2)
 ScalExp<- convexpr2nlform(yr ~ p1 + exp(-(p2 - p3 * xr)),
                        selfStart=function(data){
                            y1 <-as.double(data$yr)
                            p1<-min(y1)
                            y<-log(y1-p1+10*.Machine$double.eps)
                            x<-as.double(data$xr)
                            b1<-lm(y~x)
                            p2<- -b1$coefficients[1]
                            p3<- b1$coefficients[2]
                            return(list(p1=p1,p2=p2,p3=p3))
                        },
                        name="Scaled Exp convex",
                        start=list(p1=700,p2=21,p3=0.01)
)
 carbon.ols <- nlr(formula=ScalExp, data=crbdt, 
                  control=nlr.control(method="OLS"))
carbon.ols$curvature                  
# }

Run the code above in your browser using DataLab