Generate a formula for a MVN Cholesky model.

make_formula(formula, type = "basic")

Arguments

formula

formula.

type

character. Type of Cholesky decomposition.

Details

This is a helper to generate a formula for a bamlss model with k-dimensional multi-variate normal distribution and Cholesky decomposed variance-covariance matrix. It is helpful if one formula should be used for means, another for all diagonal entries of the Cholesky factor, and a third one for all lower triangular entries of the Cholesky factor. The left hand side has k elements separated by |. The right hand side has one to three elements separated by | specifying the formulas used for all means, diagonal entries of the Cholesky factor and lower triangular entries of the Cholesky factor, respectively.

See also

Examples

f <- O | C | E | A | N ~ s(x1) + s(x2) | s(y) | z 
f2 <- make_formula(f)
f2
#> $mu1
#> O ~ s(x1) + s(x2)
#> <environment: 0x59b331f19930>
#> 
#> $mu2
#> C ~ s(x1) + s(x2)
#> <environment: 0x59b331f19930>
#> 
#> $mu3
#> E ~ s(x1) + s(x2)
#> <environment: 0x59b331f19930>
#> 
#> $mu4
#> A ~ s(x1) + s(x2)
#> <environment: 0x59b331f19930>
#> 
#> $mu5
#> N ~ s(x1) + s(x2)
#> <environment: 0x59b331f19930>
#> 
#> $lamdiag1
#> ~s(y)
#> <environment: 0x59b331f19930>
#> 
#> $lamdiag2
#> ~s(y)
#> <environment: 0x59b331f19930>
#> 
#> $lamdiag3
#> ~s(y)
#> <environment: 0x59b331f19930>
#> 
#> $lamdiag4
#> ~s(y)
#> <environment: 0x59b331f19930>
#> 
#> $lamdiag5
#> ~s(y)
#> <environment: 0x59b331f19930>
#> 
#> $lambda12
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda13
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda14
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda15
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda23
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda24
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda25
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda34
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda35
#> ~z
#> <environment: 0x59b331f19930>
#> 
#> $lambda45
#> ~z
#> <environment: 0x59b331f19930>
#>