Commit 99a34ee6 authored by Jana Ulrich's avatar Jana Ulrich
Browse files

Fehler bei covariaten für eta und theta gefixt

parent 0b17c3d6
...@@ -337,7 +337,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { ...@@ -337,7 +337,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) {
'gev.d.fit'<- 'gev.d.fit'<-
function(xdat, ds, ydat = NULL, mul = NULL, sigl = NULL, shl = NULL, thetal = NULL, etal = NULL, function(xdat, ds, ydat = NULL, mul = NULL, sigl = NULL, shl = NULL, thetal = NULL, etal = NULL,
mulink = identity, siglink = identity, shlink = identity, thetalink = identity, etalink = identity, mulink = identity, siglink = identity, shlink = identity, thetalink = identity, etalink = identity,
muinit = NULL, siginit = NULL, shinit = NULL, thetainit = 0, etainit = NULL, muinit = NULL, siginit = NULL, shinit = NULL, thetainit = NULL, etainit = NULL,
show = TRUE, method = "Nelder-Mead", maxit = 10000, ...) show = TRUE, method = "Nelder-Mead", maxit = 10000, ...)
{ {
# #
...@@ -357,7 +357,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { ...@@ -357,7 +357,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) {
z$trans <- FALSE # indicates if fit is non-stationary z$trans <- FALSE # indicates if fit is non-stationary
# calculate initial values for mu.d, sigma_0, xi, eta using IDF.init: (thetainit=0) # calculate initial values for mu.d, sigma_0, xi, eta using IDF.init: (thetainit=0)
init.vals <- gev.d.init(xdat,ds,thetainit) init.vals <- gev.d.init(xdat,ds,ifelse(is.null(thetainit),0,thetainit[1]))
# generate covariates matrices: # generate covariates matrices:
if (is.null(mul)) { if (is.null(mul)) {
...@@ -392,8 +392,8 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { ...@@ -392,8 +392,8 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) {
} }
if (is.null(thetal)) { if (is.null(thetal)) {
thmat <- as.matrix(rep(1, length(xdat))) thmat <- as.matrix(rep(1, length(xdat)))
#if (is.null(thetainit)) if (is.null(thetainit))
# thetainit <- 0 thetainit <- 0
}else { }else {
z$trans <- TRUE z$trans <- TRUE
thmat <- cbind(rep(1, length(xdat)), ydat[, thetal]) thmat <- cbind(rep(1, length(xdat)), ydat[, thetal])
...@@ -408,7 +408,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { ...@@ -408,7 +408,7 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) {
z$trans <- TRUE z$trans <- TRUE
etmat <- cbind(rep(1, length(xdat)), ydat[, etal]) etmat <- cbind(rep(1, length(xdat)), ydat[, etal])
if (is.null(etainit)) if (is.null(etainit))
etainit <- c(init.vals$eta, rep(0, length(thetal))) etainit <- c(init.vals$eta, rep(0, length(etal)))
} }
z$model <- list(mul, sigl, shl, thetal, etal) z$model <- list(mul, sigl, shl, thetal, etal)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment