R/ptri.R

"ptri" <-

function(x, a = 0., b = a + 2.)



{



	x <- (x - a)/(b - a)



	temp <- ifelse(x < 0.5, 2. * x^2., 1. - 2. * (1. - x)^2.)



	temp <- ifelse(x < 0., 0., temp)



	ifelse(x > 1., 1., temp)



}

Try the Rlab package in your browser

Any scripts or data that you put into this service are public.

Rlab documentation built on May 5, 2022, 1:05 a.m.