Learn R Programming

bisoreg (version 1.0)

aveslope: Average slope of a Bernstein polynomial regression function

Description

This function returns the posterior distribution of the average slope of the Bernstein polynomial regression function over a given interval.

Usage

aveslope(obj, a, b)

Arguments

obj
an object returned by the bisoreg function
a
lower bound for the interval on which to calculate the slope
b
upper bound for the interval on which to calculate the slope

Value

  • Returns a vector of average slopes for each MCMC iteration in obj

Details

See A variable selection approach to Bayesian monotonic regression for details.

References

A variable selection approach to Bayesian monotonic regression.

See Also

bisoreg

Examples

Run this code
data(childgrowth)
n.thin <- 10
n.bi <- n.thin*1000
n.iter <- n.thin*15000 + n.bi
out <- gibbsiso(childgrowth$day,childgrowth$height,m=40,nmc=n.iter,nbi=n.bi,thin=n.thin)
plot(density(aveslope(out,75,150)))

Run the code above in your browser using DataLab