View source: R/simulate.kmConvex1D.R
simulate_process.kmConvex1D | R Documentation |
## S3 method for class 'kmConvex1D'
simulate_process(object, nsim, seed = NULL, newdata)
object |
kmConvex1D model |
nsim |
the number of response vectors to simulate |
seed |
optional random seed |
newdata |
a vector which represents the points where to performs predictions |
design = c(0.1, 0.5, 0.9)
response = c(10, 5, 9)
model = kmConvex1D(design, response, coef.cov = 0.35)
x = seq(0, 1,, 100)
graphics::matplot(x, y=simulate_process(object=model, newdata=x, nsim=100), type='l', col='gray', lty=1, ylab='response')
lines(x,constrSpline(object=model)(x), lty=1, col='black')
points(design, response, pch=19)
legend(0.15, 12.5, c("convex GP sample paths", "posterior max"),
col = c('gray', 'black'), text.col = "black",
lty = c(1, 1), pch=c(NA_integer_, NA_integer_), lwd = c(2, 2), text.font=1, box.lty=0, cex=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.