From 1129817fdbe33cbf2fec11d568fd2df87b9fb422 Mon Sep 17 00:00:00 2001 From: Le Roux Erwan <erwan.le-roux@irstea.fr> Date: Tue, 23 Mar 2021 18:27:15 +0100 Subject: [PATCH] [projection snowfall] add modification to try to account for gcm parameters, without success --- extreme_fit/distribution/gev/main_fevd_mle.R | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/extreme_fit/distribution/gev/main_fevd_mle.R b/extreme_fit/distribution/gev/main_fevd_mle.R index a43fda6b..972c9a64 100644 --- a/extreme_fit/distribution/gev/main_fevd_mle.R +++ b/extreme_fit/distribution/gev/main_fevd_mle.R @@ -17,13 +17,16 @@ x_gev <- rgev(N, loc = loc, scale = scale, shape = shape) # N <- 50 # loc = 0; scale = 1; shape <- 0.1 # x_gev <- rgev(N, loc = loc, scale = scale, shape = shape) -coord <- matrix(ncol=1, nrow = N) +coord <- matrix(ncol=3, nrow = N) coord[,1]=seq(0,N-1,1) -colnames(coord) = c("T") +coord[,2]=c(rep(0, N/2), rep(1, N/2)) +coord[,3]=c(rep(1, N/2), rep(0, N/2)) +colnames(coord) = c("T", "G1", "G2") +print(coord) coord = data.frame(coord, stringsAsFactors = TRUE) # res = fevd_fixed(x_gev, data=coord, method='MLE', verbose=TRUE, use.phi=FALSE) # res = fevd_fixed(x_gev, data=coord, location.fun= ~T, scale.fun= ~T, method='MLE', type="GEV", verbose=FALSE, use.phi=FALSE) -res = fevd_fixed(x_gev, data=coord, shape.fun= ~poly(T, 2), method='MLE', type="GEV", verbose=FALSE, use.phi=FALSE) +res = fevd_fixed(x_gev, data=coord, shape.fun= ~1 + (G1-G2) + I(G2), method='MLE', type="GEV", verbose=FALSE, use.phi=FALSE) print(res) # Some display for the results @@ -31,8 +34,10 @@ print(res) # print(class(res$chain.info)) # print(dim(m)) # print(m) +print("here1") print(res$results$par) -# print(res$par) +print("here2") +print(res$par) # print(m[1]) @@ -44,8 +49,8 @@ print(res$results$par) # print(res_ci) # Bug to solve for the non stationary - the returned parameter do not match with the return level -v = make.qcov(res, vals = list(mu1 = c(0.0))) -# print(res$results$num.pars$location) +# v = make.qcov(res, vals = list(mu1 = c(0.0))) +print(res$results$num.pars$location) # print(res$results$num.pars$scale) # print(res$results$num.pars$shape) # res$results$num.pars$shape = 0 -- GitLab