Learn R Programming

ORDER2PARENT (version 1.0)

parentest: Generate Smooth Estimator of Parent Distribution

Description

Using the output from blr or bgmm, this function gives rise to estimates of parent cdf for any given value.

Usage

parentest(x0, beta.hat, n.knots, degree = 3, support = NULL)

Arguments

x0
the value whose parent cdf's are wanted. It can either be a scalar or a vector.
beta.hat
the estimate of control variables.
n.knots
the number of inner knots.
degree
the degree of B-spline. The default is 3, i.e. a cubic B-spline.
support
a vector specifying the support of the parent distribution. If unknown, it can be omitted, and the interval of data will be used as the support.

Value

The estimates of parent cdf's of x0. NOTE that the degree used in parentest should be consistent with the degree used in estimation of control variables.

Details

Together with blr and/or bgmm, this function can be estimate the parent cdf of any given value.

See Also

blr, bgmm

Examples

Run this code
n.order<-c(20, 20, 60)	# number of observations for each order statistic below.
m<-5	# the size of random samples is 5.
# The three order statistics are 1:5 (the minimum), 3:5 (the sample median), 
# and 5:5 (the maximum)
rank.x<-c(1, 3, 5)
data.example<-list()
for(i in 1:3){
sorted.sample<-t(apply(matrix(rnorm(m*n.order[i]),nr=n.order[i],nc=m), 1, sort))
data.example[[i]]<-sorted.sample[,rank.x[i]]
}
order.example<-rbind(c(1, 5), c(3, 5), c(5, 5), deparse.level=0)
blr.example<-blr(data.example, order.example)
# Based on 'blr.example', we can estimate the parent cdf of given values, like data.example[[3]]
parenthat<-parentest(data.example[[3]], blr.example$betahat, blr.example$n.knots)

Run the code above in your browser using DataLab