# parentest: Generate Smooth Estimator of Parent Distribution In ORDER2PARENT: Estimate parent distributions with data of several order statistics

## Description

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

## Usage

 `1` ```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.

## Details

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

## 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.

`blr`, `bgmm`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```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) ```