Asymptotic covariance matrix of periodic mean
meanvarcheck.Rd
Asymptotic covariance matrix of periodic mean.
Arguments
- parmodel
a periodic model.
- n
number of observations (TODO: need clarification here).
- cor
if
TRUE
, return correlations- result
if
"var"
, return the diagonal of the covariance matrix, otherwise return the matrix.
Examples
x <- arima.sim(list(ar=0.9), n=1000)
proba1 <- fitPM(c(3,2,2,2), x)
meancovmat(proba1, 100)
#> [1] 0.988953 1.094719 1.121733 1.171675
meancovmat(proba1, 100, cor = TRUE)
#> [,1] [,2] [,3] [,4]
#> [1,] 1.0000000 0.9827059 0.9813786 0.9848972
#> [2,] 0.9827059 1.0000000 0.9862408 0.9808960
#> [3,] 0.9813786 0.9862408 1.0000000 0.9880167
#> [4,] 0.9848972 0.9808960 0.9880167 1.0000000
meancovmat(proba1, 100, result = "")
#> [,1] [,2] [,3] [,4]
#> [1,] 0.988953 1.022498 1.033640 1.060186
#> [2,] 1.022498 1.094719 1.092897 1.110907
#> [3,] 1.033640 1.092897 1.121733 1.132694
#> [4,] 1.060186 1.110907 1.132694 1.171675
meancovmat(proba1, 100, cor = TRUE, result = "")
#> [,1] [,2] [,3] [,4]
#> [1,] 1.0000000 0.9827059 0.9813786 0.9848972
#> [2,] 0.9827059 1.0000000 0.9862408 0.9808960
#> [3,] 0.9813786 0.9862408 1.0000000 0.9880167
#> [4,] 0.9848972 0.9808960 0.9880167 1.0000000
meanvarcheck(proba1, 100)
#> [1] 0.8907291 0.9859517 1.0093846 1.0544765