Learn R Programming

nlsmsn (version 0.0-6)

Ultrasonic: Ultrasonic Calibration

Description

The data is a result of a ultrasonic calibration study perfomed by National Institute of Standard and Technology.

Usage

data(Ultrasonic)

Arguments

Format

A data frame with 214 observations with y as the ultrasonic measuraments and x the metal distance

Examples

Run this code
# NOT RUN {
##Load the data
data(Ultrasonic)

##Define non linear function
nlf<-function(x,betas){
resp<- exp(-betas[1]*x)/(betas[2] + betas[3]*x)
return(resp)
}

##Set the response y and covariate x
y <- Ultrasonic$y
x <- Ultrasonic$x

##Set initial values
z <- x
betas <- c(0.1913, 0.0061, 0.0110)
rho <- -0.1
sigma2 <- 3.2726
shape <- 0.1698
nu <- 4

## Skew.normal regression
analysis.sn <- smsn.nl(y = y, x = x, z = z, betas = betas, sigma2 = sigma2, shape = shape, 
                       rho = rho, nlf = nlf, rho.func = 2, reg.type = "Heteroscedastic", 
                       criteria = TRUE, family = "Skew.normal", iter.max = 200)

## Skew.t regression
analysis.st <- smsn.nl(y = y, x = x, z = z, betas = betas, sigma2 = sigma2, shape = shape, nu = nu, 
                       rho = rho, nlf = nlf, rho.func = 1, reg.type = "He", 
                       criteria = TRUE, family = "Skew.t", iter.max = 200)
# }

Run the code above in your browser using DataLab