Skip to contents

This function simulates random transition matrices from the multivariate normal distribution. The function ensures that the generated transition matrices are stationary using TestStationarity().

Usage

SimBetaN(n, beta, vcov_beta_vec_l)

Arguments

n

Positive integer. Number of replications.

beta

Numeric matrix. The transition matrix (\(\boldsymbol{\beta}\)).

vcov_beta_vec_l

Numeric matrix. Cholesky factorization (t(chol(vcov_beta_vec))) of the sampling variance-covariance matrix \(\mathrm{vec} \left( \boldsymbol{\beta} \right)\).

Author

Ivan Jacob Agaloos Pesigan

Examples

n <- 10
beta <- matrix(
  data = c(
    0.7, 0.5, -0.1,
    0.0, 0.6, 0.4,
    0, 0, 0.5
  ),
  nrow = 3
)
vcov_beta_vec_l <- t(chol(0.001 * diag(9)))
SimBetaN(n = n, beta = beta, vcov_beta_vec_l = vcov_beta_vec_l)
#> [[1]]
#>            [,1]          [,2]       [,3]
#> [1,]  0.7103395 -0.0004829737 0.02370148
#> [2,]  0.4648248  0.5993776821 0.02773577
#> [3,] -0.1070794  0.3411360851 0.50429558
#> 
#> [[2]]
#>            [,1]        [,2]         [,3]
#> [1,]  0.6976265 -0.04028349 -0.002208314
#> [2,]  0.4990847  0.59542436  0.009435501
#> [3,] -0.1129286  0.37930240  0.462791572
#> 
#> [[3]]
#>            [,1]        [,2]        [,3]
#> [1,]  0.7198422 0.001385859 -0.04451615
#> [2,]  0.4743631 0.635564236  0.03050132
#> [3,] -0.1205753 0.434244293  0.47389458
#> 
#> [[4]]
#>            [,1]        [,2]       [,3]
#> [1,]  0.7029540 -0.01665823 0.03859427
#> [2,]  0.5064191  0.66389629 0.04366238
#> [3,] -0.1188096  0.39959059 0.49030928
#> 
#> [[5]]
#>            [,1]        [,2]         [,3]
#> [1,]  0.7113137 -0.06108355 -0.001098922
#> [2,]  0.4973354  0.55895700  0.048238135
#> [3,] -0.1128323  0.40398333  0.471195115
#> 
#> [[6]]
#>             [,1]        [,2]        [,3]
#> [1,]  0.68236604 -0.01742727  0.01244699
#> [2,]  0.49408692  0.62516893 -0.03988741
#> [3,] -0.07494344  0.34096968  0.52048583
#> 
#> [[7]]
#>            [,1]        [,2]         [,3]
#> [1,]  0.7111349 -0.06607776 -0.001751393
#> [2,]  0.4447285  0.58518340 -0.007643585
#> [3,] -0.1274092  0.39893216  0.435273121
#> 
#> [[8]]
#>             [,1]       [,2]         [,3]
#> [1,]  0.73225375 0.07626581 -0.001247313
#> [2,]  0.48959538 0.56803899  0.026292756
#> [3,] -0.07884372 0.37188012  0.485384475
#> 
#> [[9]]
#>             [,1]       [,2]        [,3]
#> [1,]  0.70533896 0.03822759 0.005504865
#> [2,]  0.48628058 0.62547649 0.039177440
#> [3,] -0.09795049 0.36980611 0.485140003
#> 
#> [[10]]
#>            [,1]        [,2]        [,3]
#> [1,]  0.7160153 -0.04312751 0.003212323
#> [2,]  0.5164538  0.57274293 0.067334232
#> [3,] -0.1147178  0.45638168 0.501401591
#>