Commit be805257 authored by Oscar Jurado's avatar Oscar Jurado
Browse files

Updated documentation to add the theta_zero parameter

parent 8bb9ac62
......@@ -33,6 +33,8 @@
#' @param show Logical; if TRUE (the default), print details of the fit.
#' @param method The optimization method used in \code{\link{optim}}.
#' @param maxit The maximum number of iterations.
#' @param theta_zero Logical value, indicating if theta parameter should be estimated (TRUE, the default) or
#' remain zero.
#' @param ... Other control parameters for the optimization.
#' @return A list containing the following components.
#' A subset of these components are printed after the fit.
......@@ -474,15 +476,13 @@ gev.d.params <- function(fit,ydat){
mut <- mulink(mumat %*% (fit$mle[1:npmu]))
sc0 <- siglink(sigmat %*% (fit$mle[seq(npmu + 1, length = npsc)]))
xi <- shlink(shmat %*% (fit$mle[seq(npmu + npsc + 1, length = npsh)]))
if(class(fit)=="gev.d.fit" & !fit$theta_zero){theta <- thetalink(thmat %*% (fit$mle[seq(npmu + npsc + npsh + 1, length = npth)]))}
if(class(fit)=="gev.d.fit" ){
if(!fit$theta_zero){theta <- thetalink(thmat %*% (fit$mle[seq(npmu + npsc + npsh + 1, length = npth)]))
}else{theta <- rep(0,dim(ydat)[1])}}
if(class(fit)=="gev.d.fit"){eta <- etalink(etmat %*% (fit$mle[seq(npmu + npsc + npsh + npth + 1, length = npet)]))}
if(class(fit)=="gev.d.fit"){
if(!fit$theta_zero){ #When theta parameter is used (default)
return(data.frame(mut=mut,sig0=sc0,xi=xi,theta=theta,eta=eta))
}else{ #When theta parameter was not used
return(data.frame(mut=mut,sig0=sc0,xi=xi,eta=eta))
}
return(data.frame(mut=mut,sig0=sc0,xi=xi,theta=theta,eta=eta))
}else{return(data.frame(mu=mut,sig=sc0,xi=xi))}
}
......
......@@ -10,7 +10,8 @@ gev.d.fit(xdat, ds, ydat = NULL, mul = NULL, sigl = NULL,
shlink = make.link("identity"), thetalink = make.link("identity"),
etalink = make.link("identity"), muinit = NULL, siginit = NULL,
shinit = NULL, thetainit = NULL, etainit = NULL, show = TRUE,
method = "Nelder-Mead", maxit = 10000, init.vals = NULL, ...)
method = "Nelder-Mead", maxit = 10000, init.vals = NULL,
theta_zero = FALSE, ...)
}
\arguments{
\item{xdat}{A vector containing maxima for different durations.
......@@ -45,6 +46,9 @@ used to model the parameters. If NULL (the default) is given, initial parameters
internally by fitting the GEV seperately for each duration and applying a linear model to optain the
duration dependency of the location and shape parameter.}
\item{theta_zero}{Logical value, indicating if theta parameter should be estimated (TRUE, the default) or
remain zero.}
\item{...}{Other control parameters for the optimization.}
}
\value{
......
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