ZLinear-class: ZLinear

Description Details Fields Examples

Description

Build piecewise linear log-probability density functions.

Details

This Reference Class is analogous to ZQuadratic. Objects of this class provide approximations to the input log-p.d.f. that are slightly more numerically stable, but probably worse, than those of ZQuadratic. To mitigate the worse fit, more evaluations should be provided. For details about this classe's fields and methods, see those in ZQuadratic. Although this class is not virtual, it is not exported.

Fields

n

numeric.

x

numeric.

y

numeric.

beta0

numeric.

beta1

numeric.

dx

numeric.

normct

numeric.

pcdf

numeric.

fns

list.

Examples

1
2
3
4
5
6
7
8
x <- seq(-4, 4, 0.3)
y <- dnorm(x, log = TRUE)
zq <- ZLinear(x = x, y = y)
do.log <- TRUE #switch to FALSE to see p.d.f.
zq$plot.fit(do.log)
lines(seq(-4, 4, 0.1), dnorm(seq(-4, 4, 0.1),
 log = do.log), ty = "l", lwd = 1, lty = 2)
 

rtlemos/rcrandom documentation built on May 28, 2019, 9:55 a.m.