Skip to content
This repository has been archived by the owner on May 9, 2024. It is now read-only.

confint of bivariate smooths #3

Closed
scottkosty opened this issue Apr 6, 2018 · 1 comment
Closed

confint of bivariate smooths #3

scottkosty opened this issue Apr 6, 2018 · 1 comment
Labels
enhancement New feature or request

Comments

@scottkosty
Copy link

This is a feature request for adding support for confidence intervals of bivariate smooths.

In the below example code, there is one call to confint that succeeds, but when adding a newdata argument or a type argument, it fails.

library(mgcv)
library(schoenberg)
set.seed(2)
dat <- gamSim(2, n = 4000, dist = "normal", scale = 1)
m2 <- gam(y ~ s(x, z, k = 30), data = dat$data, method = "REML")

# this works (in the sense of no error)
test1 <- confint(m2, parm = "x,z")

# however, these fail
test2 <- confint(m2, parm = "x,z", type = "simultaneous")
newd_ <- data.frame(x = dat$x, y = dat$y, z = dat$z)
test3 <- confint(m2, parm = "x,z", newdata = newd_)

# I'm guessing these are not expected to work, but I tried them just in case,
# and they do not succeed:

# since there is only one smooth, I thought I could exclude the parm
test4 <- confint(m2, newdata = newd_)
test5 <- confint(m2, type = "simultaneous")

# try specifying parm with s()
test6 <- confint(m2, parm = "s(x,z)", newdata = newd_)
test7 <- confint(m2, parm = "s(x,z)", type = "simultaneous")

# try specifying parm with number
test8 <- confint(m2, parm = 1, newdata = newd_)
test9 <- confint(m2, parm = 1, type = "simultaneous")
@gavinsimpson
Copy link
Owner

This issue was moved to gavinsimpson/gratia#1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants