Open mfasiolo opened 7 years ago
This might be a quite useful layer, see
http://www.fromthebottomoftheheap.net/2017/10/10/difference-splines-i/
To calculate the standard error for the differences in smooth we need:
cov(X1b1, X2b2) = X1 %*% Sig11 %*% t(X1) + X2 %*% Sig22 %*% t(X2) - X1 %*% Sig12 %*% t(X2) - X2 %*% Sig12 %*% t(X1)
where Sig11, Sig22 and Sig12 = Sig21 are blocks of cov(b1, b2).
Partially done here 2336af0a6f88464d1cfb33840f4947db2fcb8336, but by creating a new plotDiff generic for "by" smooths. For 'fs' smooths it might actually make sense creating a layer instead.
This might be a quite useful layer, see
http://www.fromthebottomoftheheap.net/2017/10/10/difference-splines-i/
To calculate the standard error for the differences in smooth we need:
cov(X1b1, X2b2) = X1 %*% Sig11 %*% t(X1) + X2 %*% Sig22 %*% t(X2) - X1 %*% Sig12 %*% t(X2) - X2 %*% Sig12 %*% t(X1)
where Sig11, Sig22 and Sig12 = Sig21 are blocks of cov(b1, b2).