% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit_model.R
\name{Fit_model}
\alias{Fit_model}
\title{Time-varying parameters of a given GEV model}
\usage{
Fit_model(temperatures, model)
}
\arguments{
\item{temperatures}{A vector or single-column matrix of air temperature data, either original
or centered by subtracting the sample mean.}

\item{model}{A single integer between 1 and 4 defining the GEV model.
May be provided by \code{Best_model()}.}
}
\value{
A \code{data.frame} containing the estimated parameters
(\code{mu0}, \code{mu1}, \code{sigma0}, \code{sigma1}, \code{shape},
\code{size}).  If fitting fails for a site, \code{NA}s are returned for
that site.
}
\description{
Time-varying parameters of a given GEV model
}
\details{
The function attempts to fit the model using \code{ismev::gev.fit()} with
the following optimisers in sequence:
\code{Nelder-Mead}, \code{BFGS}, \code{CG}, \code{L-BFGS-B}, \code{SANN}.
The first optimiser that converges is used; if all fail, \code{NA}s are
returned for that site.
}
\examples{
temperatures <- TmaxCPC_SP$Pixel_1
model <- 4
Fit_model(temperatures, model)
}
