diff --git a/DESCRIPTION b/DESCRIPTION index 7fe8d6812209852a7de75a7eb923886ee2847137..6bc5898fbaf0cccef6786eefbae6da7100b6096d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: CSTools Title: Assessing Skill of Climate Forecasts on Seasonal-to-Decadal Timescales -Version: 4.0.0 +Version: 4.0.1 Authors@R: c( person("Nuria", "Perez-Zanon", , "nuria.perez@bsc.es", role = c("aut", "cre"), comment = c(ORCID = "0000-0001-8568-3071")), person("Louis-Philippe", "Caron", , "louis-philippe.caron@bsc.es", role = "aut", comment = c(ORCID = "0000-0001-5221-0147")), diff --git a/NEWS.md b/NEWS.md index 23d198894d3d5db5510465662479fd0a6947b591..6dbf7005b150f5b00d773667cd3858c05b7ddd48 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +### CSTools 4.0.1 +**Submission date to CRAN: XX-06-2021** + +- Fixes: + + Calibration retains correlation absolute value + ### CSTools 4.0.0 **Submission date to CRAN: XX-12-2020** diff --git a/R/CST_Calibration.R b/R/CST_Calibration.R index 58ef720777bd5ebb58cb5a3916b48ccbe71a6414..34607bad769369c529482a229074a70af08c3857 100644 --- a/R/CST_Calibration.R +++ b/R/CST_Calibration.R @@ -416,7 +416,7 @@ Calibration <- function(exp, obs, cal.method = "mse_min", } else { par.out[3] <- with(quant.obs.fc, obs.sd * sqrt(1. - cor.obs.fc^2) / fc.dev.sd) } - par.out[2] <- with(quant.obs.fc, cor.obs.fc * obs.sd / fc.ens.av.sd) + par.out[2] <- with(quant.obs.fc, abs(cor.obs.fc) * obs.sd / fc.ens.av.sd) par.out[1] <- with(quant.obs.fc, obs.av - par.out[2] * fc.ens.av.av, na.rm = na.rm) return(par.out) @@ -473,4 +473,4 @@ Calibration <- function(exp, obs, cal.method = "mse_min", .CalibrationMembersRPC <- function(exp, ens_mean, ens_mean_cal, var_obs, var_noise, r){ member_cal <- (exp - ens_mean) * sqrt(var_obs) * sqrt(1 - r^2) / sqrt(var_noise) + ens_mean_cal return(member_cal) -} \ No newline at end of file +}