Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@
^NEWS\.md$
^README\.md$
^notes$
^cran-comments\.md$
^cran-comments\.md$
^\.claude$
^proposed_changes$
^STUDY_GUIDE
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Package: dacc
Title: Detection and Attribution Analysis of Climate Change
Version: 0.0-8
Date: 2025-12-05
Version: 0.0-10
Date: 2026-03-25
Authors@R: c(
person(given = "Yan", family = "Li",
email = "yan.4.li@uconn.edu",
role = c("aut", "cre")),
person(given = "Kun", family = "Chen", role = "aut"),
person(given = "Jun", family = "Yan", role = "aut"))
person(given = "Jun", family = "Yan", role = "aut"),
person(given = "Charles", family = "Benfer", role = "aut"))
Description:
Detection and attribution of climate change using methods including optimal fingerprinting via
generalized total least squares or an estimating equation approach (Li et al., 2025,
Expand Down
3 changes: 3 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

export(Covest)
export(fingerprint)
export(fingerprintNLS)
export(fingerprintOPT)
export(fpPrep)
import(magrittr)
import(ncdf4)
Expand All @@ -16,6 +18,7 @@ importFrom(pracma,ceil)
importFrom(sp,point.in.polygon)
importFrom(stats,cov)
importFrom(stats,pnorm)
importFrom(stats,qchisq)
importFrom(stats,qnorm)
importFrom(stats,quantile)
importFrom(stats,sd)
Expand Down
17 changes: 16 additions & 1 deletion R/Covest.R
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,22 @@ lwRegcov <- function(Z) {
b2 * m / d2 * Ip + a2 / d2 * sample.cov
}


lwRegcov.lam <- function(Z) {
n <- nrow(Z)
p <- ncol(Z)
sample.cov <- cov(Z)
Ip <- diag(p)
m <- sum(diag(sample.cov %*% Ip)) / p
Zp <- sample.cov - m * Ip
d2 <- sum(diag(Zp %*% t(Zp))) / p
bt <- (diag(Z %*% t(Z))^2 -
2 * diag(Z %*% sample.cov %*% t(Z)) +
rep(1, n) * sum(diag(sample.cov %*% sample.cov))) / p
bb2 <- 1 / n^2 * sum(bt)
b2 <- min(bb2, d2)
a2 <- d2 - b2
b2 * m / a2
}



Expand Down
Loading