[<-.SSModel | R Documentation |
S3 methods for getting and setting parts of object of class
SSModel
. These methods ensure that dimensions of system matrices are
not altered.
## S3 replacement method for class 'SSModel'
x[element, states, etas, series, times, ...] <- value
## S3 method for class 'SSModel'
x[element, states, etas, series, times, drop = TRUE, ...]
x |
Object of class |
element |
Which element(s) is chosen. Typical values are |
states |
Which states are chosen. Either a numeric vector containing the indices of the
states, or a character vector defining the types of the states. Possible choices are
|
etas |
Which disturbances eta are chosen. Used for elements |
series |
Numeric. Which series are chosen. Used for elements
|
times |
Numeric. Which time points are chosen. |
... |
Ignored. |
value |
A value to be assigned to x. |
drop |
Logical. If |
If element
is not one of
"y"
, "Z"
, "H"
, "T"
, "R"
, "Q"
,
"a1"
, "P1"
, "P1inf"
, "u"
,
the default single bracket list extraction
and assignments (x[element]
and x[element] <- value
)
are used (and other arguments are ignored).
If element
is one of
"y"
, "Z"
, "H"
, "T"
, "R"
, "Q"
,
"a1"
, "P1"
, "P1inf"
, "u"
and if the arguments
states
, etas
, times
and series
are
all missing, the double bracket list
extraction x[[element]]
and modified double bracket list assignment
x[[element]][] <- value
are used.
If neither of above holds, then for example in case of element = Z
the extraction is of form x$Z[series, states, times, drop]
.
A selected subset of the chosen element or a value.
set.seed(1)
model <- SSModel(rnorm(10) ~ 1)
model["H"]
model["H"] <- 10
# H is still an array:
model["H"]
logLik(model)
model$H <- 1
# model["H"] throws an error as H is now scalar:
model$H
logLik(model, check.model = TRUE) #with check.model = FALSE R crashes!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.