Commit 99a34ee6 by Jana Ulrich

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) { 'gev.d.fit'<- 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, 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, ...) { # ... ... @@ -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 # 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: if (is.null(mul)) { ... ... @@ -392,12 +392,12 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { } if (is.null(thetal)) { thmat <- as.matrix(rep(1, length(xdat))) #if (is.null(thetainit)) # thetainit <- 0 if (is.null(thetainit)) thetainit <- 0 }else { z\$trans <- TRUE thmat <- cbind(rep(1, length(xdat)), ydat[, thetal]) if (is.null(thetainit)) if (is.null(thetainit)) thetainit <- c(0, rep(0, length(thetal))) } if (is.null(etal)) { ... ... @@ -408,13 +408,13 @@ IDF.nll <- function(mu=0,sigma=1,xi=0,theta=0,eta=1,x,d,use.log=F,DEBUG=F) { z\$trans <- TRUE etmat <- cbind(rep(1, length(xdat)), ydat[, etal]) 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\$link <- deparse(substitute(c(mulink, siglink, shlink, thetalink, etalink))) init <- c(muinit, siginit, shinit, thetainit, etainit) # function to calculate neg log-likelihood: gev.lik <- function(a) { # computes neg log lik of gev(d) model ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!