smdtape <- tape_smd("sim", "sqrt", "sph", "ppi",
ytape = rep(1/3, 3),
usertheta = ppi_paramvec(p = 3),
bdryw = "minsq", acut = 0.01,
verbose = FALSE
)$smdtape
Y <- rppi_egmodel(100)
cppad_search(smdtape, 0.9 * Y$theta, Y$sample)
sum((smvalues_wsum(smdtape, Y$sample, Y$theta)$grad/nrow(Y$sample))^2)
Run the code above in your browser using DataLab