Description Usage Arguments Value Examples
Title Function to fit a PTSR model
1 2 3 4 |
start |
a vector with the starting values for the non-fixed coefficients of the model. |
yt |
the time series |
xreg |
optionally, a vector or matrix of external regressors. Default is |
xregar |
logical, if |
fit.alpha |
logical, if FALSE, alpha is set to zero. Default is |
p |
order of the AR polinomial |
q |
order of the MA polinomial |
arlag |
the lags to be included in the AR polinomial. Default is |
malag |
the lags to be included in the MA polinomial. Default is |
ddist |
function, the density function to be used |
link1 |
character indicating which link must be used for μ_t. See |
link2 |
character indicating which link must be used for y_t in the AR recursion. See |
g1 |
optionally, a link function to be used for μ_t. Default is |
g1.inv |
optionally, a the inverse link function to be used for η_t. It must the the ivnerse of |
g2 |
optionally, a link function to be used for y_t. Default is |
method |
The method to be used. See [optim][stats::optim] for details. |
... |
Further arguments to be passed to |
The same arguments return by optim
plus a the following arguments
coefficients
: a vector with the estimated coefficients;
sll
: the sum of the log-likelihood for the fitted model;
series
: the original time series;
xreg
: the regressors (if any);
fitted.values
: the conditional mean, which corresponds to
the in-sample forecast, also denoted fitted values;
residuals
: the observed minus the fitted values;
model
: a list with the configurations used to fit the model.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | #-------------------------------------------------------------------
# Gamma-ARMA(1,1) model with no regressors
#-------------------------------------------------------------------
simu = ptsr.sim(n = 3000, burn = 50,
varphi = 20, alpha = 0,
phi = 0.35, theta = 0.2,
seed = 1234, rdist = r.gamma,
link1 = "log", link2 = "log")
fit1 = ptsr.fit(start = c(0,0,0,10), yt = simu$yt,
fit.alpha = TRUE, p = 1, q = 1,
ddist = d.gamma, link1 = "log",
link2 = "log", method = "L-BFGS-B")
summary(fit1)
# removing alpha from the model
fit2 = ptsr.fit(start = c(0,0,10), yt = simu$yt,
fit.alpha = FALSE, p = 1, q = 1,
ddist = d.gamma, link1 = "log",
link2 = "log", method = "L-BFGS-B")
summary(fit2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.