ngme AR(p) model specification

ar(mesh, rho = NULL, order = NULL, ...)

Arguments

mesh

integer vector or inla.mesh.1d object, index to build the mesh

rho

vector of AR coefficients of length p (should satisfy stationarity conditions)

order

integer, the AR order p. If provided and rho is not specified, rho will be initialized as rep(0, p)

...

ignore

Value

ngme_operator object

Examples

# AR(2) model with specified coefficients
ar(c(1:10), rho = c(0.5, -0.3))
#> Model type: AR(2)
#>     rho1 = 0.5
#>     rho2 = -0.3
# AR(3) model with specified coefficients 
ar(c(1:10), rho = c(0.4, 0.2, -0.1))
#> Model type: AR(3)
#>     rho1 = 0.4
#>     rho2 = 0.2
#>     rho3 = -0.1
# AR(2) model with default coefficients (zeros)
ar(c(1:10), order = 2)
#> Model type: AR(2)
#>     rho1 = 0
#>     rho2 = 0
# AR(3) model with specified order and coefficients
ar(c(1:10), order = 3, rho = c(0.4, 0.2, -0.1))
#> Model type: AR(3)
#>     rho1 = 0.4
#>     rho2 = 0.2
#>     rho3 = -0.1