Description Usage Arguments Value Details References Examples
Computing the log likelihood function of a CARFIMA(p, H, q) model
1 | carfima.loglik(Y, time, ar.p, ma.q, parameter, fitted = FALSE)
|
Y |
A vector for the k observed data. |
time |
A vector for the k observation times. |
ar.p |
A positive integer for the order of the AR model. |
ma.q |
A non-negative integer for the order of the MA model. |
parameter |
The values of the unknown parameters at which the log likelihood is evaluated.
For example, users need to specify five values, α_1, α_2, β_1, H, and σ
for |
fitted |
If |
Either a list of fitted values(fitted
) and AIC(AIC
), or a numeric value of the log likelihood.
The function carfima.loglik
computes the log likelihood of a CARFIMA(p,H,q)
model via the innovation algorithm
whose computational cost increases linearly as the size of the data increases. See the reference for details.
tsai_note_2000carfima
\insertReftsai_maximum_2005carfima
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | ##### Irregularly spaced observation time generation.
length.time <- 100
time.temp <- rexp(length.time, rate = 2)
time <- rep(NA, length.time + 1)
time[1] <- 0
for (i in 2 : (length.time + 1)) {
time[i] <- time[i - 1] + time.temp[i - 1]
}
time <- time[-1]
##### Data genration for CARFIMA(1, H, 0) based on the observation times.
parameter <- c(-0.4, 0.75, 0.2)
# AR parameter alpha = -0.4
# Hurst parameter = 0.75
# process uncertainty (standard deviation) sigma = 0.2
y <- carfima.sim(parameter = parameter, time = time, ar.p = 1, ma.q = 0)
##### Compute
output = carfima::carfima.loglik(Y=y,time=time,ar.p=1,ma.q=0,parameter=parameter,fitted=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.