n_params: Calculate the number of parameters

Description Usage Arguments Value

View source: R/argumentChecks.R

Description

n_params calculates the number of parameters that should be in the parameter vector.

Usage

1
2
3
4
5
6
7
n_params(
  p,
  M,
  model = c("GMAR", "StMAR", "G-StMAR"),
  restricted = FALSE,
  constraints = NULL
)

Arguments

p

a positive integer specifying the autoregressive order of the model.

M
For GMAR and StMAR models:

a positive integer specifying the number of mixture components.

For G-StMAR models:

a size (2x1) integer vector specifying the number of GMAR type components M1 in the first element and StMAR type components M2 in the second element. The total number of mixture components is M=M1+M2.

model

is "GMAR", "StMAR", or "G-StMAR" model considered? In the G-StMAR model, the first M1 components are GMAR type and the rest M2 components are StMAR type.

restricted

a logical argument stating whether the AR coefficients φ_{m,1},...,φ_{m,p} are restricted to be the same for all regimes.

constraints

specifies linear constraints imposed to each regime's autoregressive parameters separately.

For non-restricted models:

a list of size (pxq_{m}) constraint matrices C_{m} of full column rank satisfying φ_{m}=C_{m}ψ_{m} for all m=1,...,M, where φ_{m}=(φ_{m,1},...,φ_{m,p}) and ψ_{m}=(ψ_{m,1},...,ψ_{m,q_{m}}).

For restricted models:

a size (pxq) constraint matrix C of full column rank satisfying φ=, where φ=(φ_{1},...,φ_{p}) and ψ=ψ_{1},...,ψ_{q}.

The symbol φ denotes an AR coefficient. Note that regardless of any constraints, the autoregressive order is always p for all regimes. Ignore or set to NULL if applying linear constraints is not desired.

Value

Returns the number of parameters.


uGMAR documentation built on Jan. 24, 2022, 5:10 p.m.