Commit ff97df27 authored by janaulrich's avatar janaulrich
Browse files

fixed gev.d.params (didn not work for gev because theta_zero does not exist there)

parent aed76099
......@@ -448,10 +448,12 @@ gev.d.params <- function(fit,ydat){
npmu <- length(fit$model[[1]]) + 1
npsc <- length(fit$model[[2]]) + 1
npsh <- length(fit$model[[3]]) + 1
if(class(fit)=="gev.d.fit" & !fit$theta_zero){npth <- length(fit$model[[4]]) + 1} #Including theta parameter (default)
if(class(fit)=="gev.d.fit" & fit$theta_zero){npth <- 0} #With no theta parameter, asked by user
if(class(fit)=="gev.d.fit"){npet <- length(fit$model[[5]]) + 1}
if(class(fit)=="gev.d.fit"){
if(!fit$theta_zero){npth <- length(fit$model[[4]]) + 1 #Including theta parameter (default)]
}else{npth <- 0}#With no theta parameter, asked by user
npet <- length(fit$model[[5]]) + 1
}
# inverse link functions
if(class(fit)=="gev.d.fit"){
mulink <- fit$link$mulink$linkinv
......@@ -469,8 +471,10 @@ gev.d.params <- function(fit,ydat){
mumat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[1]]],dim(ydat)[1],npmu-1))
sigmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[2]]],dim(ydat)[1],npsc-1))
shmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[3]]],dim(ydat)[1],npsh-1))
if(class(fit)=="gev.d.fit" & !fit$theta_zero){thmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[4]]],dim(ydat)[1],npth-1))}
if(class(fit)=="gev.d.fit"){etmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[5]]],dim(ydat)[1],npet-1))}
if(class(fit)=="gev.d.fit"){
if(!fit$theta_zero){thmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[4]]],dim(ydat)[1],npth-1))}
etmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[5]]],dim(ydat)[1],npet-1))
}
# calculate parameters
mut <- mulink(mumat %*% (fit$mle[1:npmu]))
......
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