Coefficient function for MARSS MLE objects
coef_marssMLE.Rd
MARSS()
outputs marssMLE
objects. coef(object)
, where object
is the output from a MARSS()
call, will print out the estimated parameters. The default output is a list with values for each parameter, however the output can be altered using the type
argument to output a vector of all the estimated values (type="vector"
) or a list with the full parameter matrix with the estimated and fixed elements (type="matrix"
). For a summary of the parameter estimates with CIs from the estimated Hessian, use try tidy(object)
.
Usage
# S3 method for marssMLE
coef(object, ..., type = "list", form = NULL, what = "par")
Arguments
- object
A
marssMLE
object.- ...
Other arguments. Not used.
- type
What to output. Default is "list". Options are
- "list"
A list of only the estimated values in each matrix. Each model matrix has it's own list element.
- "vector"
A vector of all the estimated values in each matrix.
- "matrix"
A list of the parameter matrices each parameter with fixed values at their fixed values and the estimated values at their estimated values. Time-varying parameters, including d and c in a marxss form model, are returned as an array with time in the 3rd dimension.
- parameter name
Returns the parameter matrix for that parameter with fixed values at their fixed values and the estimated values at their estimated values. Note, time-varying parameters, including d and c in a marxss form model, are returned as an array with time in the 3rd dimension.
- form
This argument can be ignored. By default, the model form specified in the call to
MARSS()
is used to determine how to display the coefficients. This information is inattr(object$model,"form")
. The default form is"marxss"
; seeMARSS.marxss()
. However, the internal functions convert this to form"marss"
; seeMARSS.marss()
. The marss form of the model is stored (inobject$marss
). You can look at the coefficients in marss form by passing inform="marss"
.- what
By default,
coef()
shows the parameter estimates. Other options are "par.se", "par.lowCI", "par.upCI", "par.bias", and "start".
Examples
dat <- t(harborSeal)
dat <- dat[c(2, 11), ]
fit <- MARSS(dat)
#> Success! abstol and log-log tests passed at 26 iterations.
#> Alert: conv.test.slope.tol is 0.5.
#> Test with smaller values (<0.1) to ensure convergence.
#>
#> MARSS fit is
#> Estimation method: kem
#> Convergence test: conv.test.slope.tol = 0.5, abstol = 0.001
#> Estimation converged in 26 iterations.
#> Log-likelihood: 11.74016
#> AIC: -9.480311 AICc: -6.3692
#>
#> Estimate
#> R.diag 0.0115
#> U.X.CoastalEstuaries 0.0613
#> U.X.OR.NorthCoast 0.0510
#> Q.(X.CoastalEstuaries,X.CoastalEstuaries) 0.0147
#> Q.(X.OR.NorthCoast,X.OR.NorthCoast) 0.0122
#> x0.X.CoastalEstuaries 7.3823
#> x0.X.OR.NorthCoast 6.2707
#> Initial states (x0) defined at t=0
#>
#> Standard errors have not been calculated.
#> Use MARSSparamCIs to compute CIs and bias estimates.
#>
coef(fit)
#> $Z
#> [,1]
#>
#> $A
#> [,1]
#>
#> $R
#> [,1]
#> diag 0.01148472
#>
#> $B
#> [,1]
#>
#> $U
#> [,1]
#> X.CoastalEstuaries 0.06134704
#> X.OR.NorthCoast 0.05099574
#>
#> $Q
#> [,1]
#> (X.CoastalEstuaries,X.CoastalEstuaries) 0.01468309
#> (X.OR.NorthCoast,X.OR.NorthCoast) 0.01218082
#>
#> $x0
#> [,1]
#> X.CoastalEstuaries 7.382266
#> X.OR.NorthCoast 6.270672
#>
#> $V0
#> [,1]
#>
#> $G
#> [,1]
#>
#> $H
#> [,1]
#>
#> $L
#> [,1]
#>
#> $C
#> [,1]
#>
#> $D
#> [,1]
#>
#> $c
#> [,1]
#>
#> $d
#> [,1]
#>
coef(fit, type = "vector")
#> R.diag
#> 0.01148472
#> U.X.CoastalEstuaries
#> 0.06134704
#> U.X.OR.NorthCoast
#> 0.05099574
#> Q.(X.CoastalEstuaries,X.CoastalEstuaries)
#> 0.01468309
#> Q.(X.OR.NorthCoast,X.OR.NorthCoast)
#> 0.01218082
#> x0.X.CoastalEstuaries
#> 7.38226633
#> x0.X.OR.NorthCoast
#> 6.27067221
coef(fit, type = "matrix")
#> $Z
#> X.CoastalEstuaries X.OR.NorthCoast
#> CoastalEstuaries 1 0
#> OR.NorthCoast 0 1
#>
#> $A
#> [,1]
#> CoastalEstuaries 0
#> OR.NorthCoast 0
#>
#> $R
#> CoastalEstuaries OR.NorthCoast
#> CoastalEstuaries 0.01148472 0.00000000
#> OR.NorthCoast 0.00000000 0.01148472
#>
#> $B
#> X.CoastalEstuaries X.OR.NorthCoast
#> X.CoastalEstuaries 1 0
#> X.OR.NorthCoast 0 1
#>
#> $U
#> [,1]
#> X.CoastalEstuaries 0.06134704
#> X.OR.NorthCoast 0.05099574
#>
#> $Q
#> X.CoastalEstuaries X.OR.NorthCoast
#> X.CoastalEstuaries 0.01468309 0.00000000
#> X.OR.NorthCoast 0.00000000 0.01218082
#>
#> $x0
#> [,1]
#> X.CoastalEstuaries 7.382266
#> X.OR.NorthCoast 6.270672
#>
#> $V0
#> X.CoastalEstuaries X.OR.NorthCoast
#> X.CoastalEstuaries 0 0
#> X.OR.NorthCoast 0 0
#>
#> $D
#> [,1]
#> CoastalEstuaries 0
#> OR.NorthCoast 0
#>
#> $C
#> [,1]
#> X.CoastalEstuaries 0
#> X.OR.NorthCoast 0
#>
#> $d
#> [,1]
#> [1,] 0
#>
#> $c
#> [,1]
#> [1,] 0
#>
#> $G
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#>
#> $H
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#>
#> $L
#> [,1] [,2]
#> [1,] 1 0
#> [2,] 0 1
#>
# to retrieve just the Q matrix
coef(fit, type = "matrix")$Q
#> X.CoastalEstuaries X.OR.NorthCoast
#> X.CoastalEstuaries 0.01468309 0.00000000
#> X.OR.NorthCoast 0.00000000 0.01218082