mle_var: Maximum likelihood estimation of a VAR(p)

Description Usage Examples

View source: R/VAR-2-estimation.R

Description

Maximum likelihood estimation of a VAR(p)

Usage

1
mle_var(Y, p, init, log_lik = log_lik_init(Y, p), gradient)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
K <- 3
N <- 5E2
p <- 2

set.seed(8191)

A <- matrix(0.1, K, K * p)
Y0 <- matrix(0, K, p)
U <- matrix(rnorm(K * N), K, N)

Y <- create_varp_data(A, Y0, U)

mu <- rep(0, K)
A <- matrix(0.1, K, K * p)
SIGMA <- matrix(0, K, K)
diag(SIGMA) <- 1

args <- c(mu = mu, a = vec(A), s = vech(SIGMA))

ols_fit <- ols_mv(Y = Y, p = p, const = TRUE)

mle_fit <- mle_var(Y, p)

mle_fit$BETA.hat
ols_fit$BETA.hat

mle_fit$SIGMA.hat
ols_fit$SIGMA.hat

mle_fit$std.err
ols_fit$std.err

nielsaka/zeitreihe documentation built on March 17, 2020, 8:38 p.m.