Description Usage Arguments Value Notes on inputted quantiles to be estimated Notes on estimation
View source: R/get_quantiles.R
get.quantiles
performs quantile regressions on the time series
model.y
to estimate the quantiles given by q_bulk
and
q_tail
, after normalizing using q_norm
. Specifically,
the quantiles q_norm
are estimated on model.y
model.y
is normalized, by subtracting the estimated quantile
q_norm[2]
and dividing by the IQR of estimated quantiles
q_norm[3]-q_norm[1]
the quantiles q_bulk
are estimated on the normalized model.y
the high tail and low tail are calculated by subtracting the max and min
estimated quantile (from 3.) from the normalized model.y
the quantiles q_tail
are estimated from the high tail and low tail
exceedences (so from exceedence[exceedence>0]
for the high and low)
1 2 3 4 |
model.y |
the temperature time series, as either a numeric vector or an
|
norm.x.df, bulk.x.df, tail.x.df |
degrees of freedom for the basis
functions, as |
q_norm |
a |
q_bulk |
a vector giving the non-tail quantiles to be estimated |
q_tail |
a vector giving the tail quantiles to be estimated - these are
calculated with respect to the min and max of |
year.range |
manual specification of the year range (as a |
lat, lon |
the latitude/longitude of the pixel. If |
bases.dir |
directory where the basis functions are stored. Within the
normal file structure, this would be " |
norm.x, bulk.x, tail.x |
directly input bases (calculated with
|
get.volc |
if loading or calculating basis functions, sets whether or
not to include the volcanic CO2 fit in the normalization basis function (by
default |
A list is returned, with list members giving the fit coefficients for
the normalization, bulk/primary, and tail fits (coef_norm
,
coef_bulk
, and coef_tail
, respectively), in addition to the
inputted q_bulk
, q_tail
, q_norm
, q_all
(a
listing of all the estimated quantiles), norm.x.df
,
bulk.x.df
, and tail.x.df
, and lat
, lon
, and
year.range
.
quantiles used for normalization. model.y
is normalized by
subtracting the estimated q_norm[2]
and dividing by the
estimated IQR q_norm[3]-q_norm[1]
. We therefore suggest to keep
q_norm[2] == 0.5
(the median).
primary, non-tail quantiles to estimate (post-normalization)
tail quantiles to estimate; based on exceedences of the post-
normalized model.y
beyond the max and min estimated q_bulk
.
Note that q_tail
is based on the exceedence, so if you set
q_tail[1]
to 0.75
, that 'real' value of that quantile is actually
max(q_bulk)+(1-max(q_bulk))*0.75
, and so forth.
Quantiles are estimated using quantile regression, with cubic spline basis
functions, with degrees of freedom set by norm.x.df
,
bulk.x.df
, and tail.x.df
, for the normalization, bulk, and
tail exceedence quantile calculations, respectively. The basis functions
are either loaded (if they exist in the bases.dir
, this requires
bases to be calculated using get.predictors
), calculated from
scratch using get.predictors
, or directly inputted using the
function parameters norm.x
, bulk.x
, and tail.x
.
Loading pre- calculated bases is generally the fastest method.
Each of norm.x.df
, bulk.x.df
, and tail.x.df
is a
3 x 1
vector giving the degrees of freedom for the seasonal cycle
(based only on the month-of-year), the long-term change (based only on the
year), and the interaction (changing seasonal cycle, based on both
month-of-year and year), respectively.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.