npars.term: Number of Parameters

View source: R/npars.R

npars.termR Documentation

Number of Parameters

Description

Gets the number of parameters of an object.

The default methods returns the length of pars() if none are NA, otherwise it returns NA.

Usage

## S3 method for class 'term'
npars(x, scalar = NULL, ...)

Arguments

x

An object.

scalar

A flag specifying whether to by default return all parameters (NULL), or only scalar parameters (TRUE) or only non-scalar parameters (FALSE).

...

Other arguments passed to methods.

Value

An integer scalar of the number of parameters.

See Also

pars()

Other MCMC dimensions: nchains(), niters(), nsams(), nsims(), nterms()

Other parameters: pars(), set_pars()

Examples

npars(term("sigma", "alpha[1]", "alpha[2]", "beta[1,1]", "beta[2,1]"))

term documentation built on Sept. 29, 2022, 5:14 p.m.