# ssm2bssm

Convert standard state-space model to Bayesian state-space model

## Description

The `ssm2bssm`

function converts a specified standard,
linear state-space model (`ssm`

object) to a Bayesian state-space model
(`bssm`

object)
specifying the state-space model structure (likelihood) and the joint prior distribution of
the parameters *θ*. Both models have the same state-space structure and use
the Kalman filter, but parameter estimation and analysis of the standard model involves
maximum likelihood and associated results, while the Bayesian model involves posterior
sampling.

Because the `ssm`

function enables you to create a standard linear
state-space model by explicitly specifying coefficient matrices, standard-to-Bayesian model
conversion can be convenient for simpler state-space models. For moderate through complex
models, create a Bayesian state-space model directly by using the `bssm`

function.

converts the standard, linear state-space model `MdlBSSM`

= ssm2bssm(`MdlSSM`

)`MdlSSM`

, an `ssm`

object with unknown parameters, to a Bayesian state-space model
`MdlBSSM`

, a `bssm`

object. Both
models have the same state-space structure. The joint prior density
*Π*(*θ*), which is stored in
`MdlBSSM.ParamDistribution`

, is proportional to 1.

specifies `MdlBSSM`

= ssm2bssm(`MdlSSM`

,`ParamDistribution`

)*Π*(*θ*), the log joint prior density function
of the state-space model parameters `ParamDistribution`

.

## Examples

## Input Arguments

## Output Arguments

## Tips

To determine the order of the parameters for the first input argument

of the log joint prior density function`theta`

`ParamDistribution`

, display the standard state-space model`MdlSSM`

at the command line. MATLAB labels the parameters`c`

under the`j`

`State equations`

and`Observation equations`

headings, where

is the index of the parameter in the vector`j`

.`theta`

For example, consider the following display of the standard state-space model

`MdlSSM`

.In this case,MdlSSM = State-space model type: ssm [ ... ] State equations: x1(t) = (c1)x1(t-1) + (c2)x2(t-1) + (c3)u1(t) x2(t) = x1(t-1) Observation equation: y1(t) = x1(t) + (c4)e1(t) [...]

is a 4-by-1 vector, where:`theta`

is(1)`theta`

`c1`

, the lag 1 AR coefficient of state variable*x*_{1,t}.

is(2)`theta`

`c2`

, the lag 2 AR coefficient of state variable*x*_{1,t}.

is(3)`theta`

`c3`

, the standard deviation of state disturbance*u*_{1,t}.

is(4)`theta`

`c4`

, the standard deviation of observation innovation*ε*_{1,t}.

## Version History

**Introduced in R2022a**