Commit 886fb4d5 authored by jana ulrich's avatar jana ulrich
Browse files

version 2.1.1 released to CRAN

parent 0b9443de
...@@ -621,7 +621,7 @@ gev.d.diag <- function(fit,subset=NULL,cols=NULL,pch=NULL,which='both',mfrow=c(1 ...@@ -621,7 +621,7 @@ gev.d.diag <- function(fit,subset=NULL,cols=NULL,pch=NULL,which='both',mfrow=c(1
gev.d.params <- function(fit,ydat=NULL){ gev.d.params <- function(fit,ydat=NULL){
if(!class(fit)%in%c("gev.d.fit","gev.fit"))stop("'fit' must be an object returned by 'gev.d.fit' or 'gev.fit'.") if(!inherits(fit,c("gev.fit","gev.d.fit")))stop("'fit' must be an object returned by 'gev.d.fit' or 'gev.fit'.")
if(!is.null(ydat)){ if(!is.null(ydat)){
# check covariates matrix # check covariates matrix
if(!is.matrix(ydat))stop("'ydat' must be of class matrix.") if(!is.matrix(ydat))stop("'ydat' must be of class matrix.")
...@@ -636,7 +636,7 @@ gev.d.params <- function(fit,ydat=NULL){ ...@@ -636,7 +636,7 @@ gev.d.params <- function(fit,ydat=NULL){
npmu <- length(fit$model[[1]]) + 1 npmu <- length(fit$model[[1]]) + 1
npsc <- length(fit$model[[2]]) + 1 npsc <- length(fit$model[[2]]) + 1
npsh <- length(fit$model[[3]]) + 1 npsh <- length(fit$model[[3]]) + 1
if(class(fit)=="gev.d.fit"){ if(inherits(fit,"gev.d.fit")){
if(!fit$theta_zero){ if(!fit$theta_zero){
npth <- length(fit$model[[4]]) + 1 #Including theta parameter (default)] npth <- length(fit$model[[4]]) + 1 #Including theta parameter (default)]
}else{ }else{
...@@ -656,7 +656,7 @@ gev.d.params <- function(fit,ydat=NULL){ ...@@ -656,7 +656,7 @@ gev.d.params <- function(fit,ydat=NULL){
} }
# inverse link functions # inverse link functions
if(class(fit)=="gev.d.fit"){ if(inherits(fit,"gev.d.fit")){
mulink <- fit$link$mutlink$linkinv mulink <- fit$link$mutlink$linkinv
siglink <- fit$link$sigma0link$linkinv siglink <- fit$link$sigma0link$linkinv
shlink <- fit$link$xilink$linkinv shlink <- fit$link$xilink$linkinv
...@@ -674,7 +674,7 @@ gev.d.params <- function(fit,ydat=NULL){ ...@@ -674,7 +674,7 @@ gev.d.params <- function(fit,ydat=NULL){
mumat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[1]]],dim(ydat)[1],npmu-1)) 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)) 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)) shmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[3]]],dim(ydat)[1],npsh-1))
if(class(fit)=="gev.d.fit"){ if(inherits(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))} 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)) etmat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[5]]],dim(ydat)[1],npet-1))
if(!fit$eta2_zero) {e2mat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[6]]],dim(ydat)[1],npe2-1))} if(!fit$eta2_zero) {e2mat <- cbind(rep(1, dim(ydat)[1]), matrix(ydat[, fit$model[[6]]],dim(ydat)[1],npe2-1))}
...@@ -685,7 +685,7 @@ gev.d.params <- function(fit,ydat=NULL){ ...@@ -685,7 +685,7 @@ gev.d.params <- function(fit,ydat=NULL){
mut <- mulink(mumat %*% (fit$mle[1:npmu])) mut <- mulink(mumat %*% (fit$mle[1:npmu]))
sc0 <- siglink(sigmat %*% (fit$mle[seq(npmu + 1, length = npsc)])) sc0 <- siglink(sigmat %*% (fit$mle[seq(npmu + 1, length = npsc)]))
xi <- shlink(shmat %*% (fit$mle[seq(npmu + npsc + 1, length = npsh)])) xi <- shlink(shmat %*% (fit$mle[seq(npmu + npsc + 1, length = npsh)]))
if(class(fit)=="gev.d.fit"){ if(inherits(fit,"gev.d.fit")){
if(!fit$theta_zero){ if(!fit$theta_zero){
theta <- thetalink(thmat %*% (fit$mle[seq(npmu + npsc + npsh + 1, length = npth)])) theta <- thetalink(thmat %*% (fit$mle[seq(npmu + npsc + npsh + 1, length = npth)]))
}else{ }else{
......
## Resubmission
This is a resubmission. In this version I have:
* substituted all comparisons of class() to string by using inherits()
## Test environments ## Test environments
* local: Debian Linux 4.19.160-2, R 4.1.0 * local: Debian Linux 4.19.160-2, R 4.1.0
* win-builder (devel and release) * win-builder (devel and release)
......
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