Functions to run and estimate the model
Once the transition and measurement equations have been specified, we are ready to estimate the model parameters and to calculate the latent variables conditional con the data.
Estimation can be conducted using two alternative likelihood definitions. For models where non-stationary latent variables enter the measurement equations with a coefficient, the correct approach is to use the marginal likelihood definition by Francke et al.(2010). Alternatively, the more usual diffuse likelihood remains valid for models where the parameters of the measurement equation are independent from the non-stationary latent factors.
In both cases, it is possible to use the so-called concentrated likelihood. You can think of it as if all the stochastic disturbances defined in the model would have a common term that is isolated. The Levenberg-Marquardt numerical optimization method is applied in this case. When the model is specified, the user needs to understand whether the parameters are identifiable. If none of the shock variances are fixed, the software will fix to one the one that could be larger a priory. Since all variances are multiplied by a scale (concentrating factor), this operation does not result on an overidentification of the model. However, the sofware (or the user) may end up fixing a variance for a stochastic process that is almost deterministic. In that case, the resulting scaling or concentrating factor may be very close to zero, which would lead to serious instabilities during the Levenberg-Marquardt optimization procedure. For the remaining shocks, when the sofware detects that their estimates may be close to zero, the algorithm continues under the assumption that they are equal to zero, and after a few iterations, such an assumption is relaxed through the use of the Broyden–Fletcher–Goldfarb–Shanno algorithm, which does not exploit the concentrated likelihood.
Alternatively, choosing upfront not to concentrate the likelihood will trigger the Broyden–Fletcher–Goldfarb–Shanno method. In this case, the parameter regions with small variances can be explored effectively. In this case, none of the variances are fixed by the alrogithm. However, it remains responsibility of the user to ensure that the model parameters are identifiable.
estimate
output
Creates a JD+ object of the class JD3_ProcResults
, which includes the estimated parameters, the value of the likelihood function and the first and second
moments of the latent variables conditional on the data
usage
estimate(object,data, precision, marginal, concentrated, initialParameters)
Argument | Definition | Default | Remarks |
---|---|---|---|
object | state-space model belonging to JD3_SsfModel class | ||
data | data matrix (one time series per column, time series dimension on the rows) | the data can have missing values | |
precision | double indicating the largest likelihood deviations that make the algorithm stop | 1e-15 | |
marginal | logical value used to specify whether the marginal likelihood definition is used (TRUE) or not (FALSE) during the optimization | FALSE | The marginal likelihood is recommended when there is at least one variable that loads on a non-stationary latent variable and the loading coefficient needs to be estimated. In this situation, Francke et al. (2010) show that using the likelihood function might be misleading |
concentrated | logical value used to specify whether the likelihood is concentrated (TRUE) or not (FALSE) during the optimization | TRUE | The optimization algorithm used is different in each case |
initialParameters | numeric array containing the value of the parameters | NULL | By default, the parameter values specified when both measurement and transition equations are used is defined. If the estimated parameters of your model are given by p=result(model, "parameters"), it makes sense to use the variable p as initial parameters for an estimation based on an updated sample (i.e. initialParameters=p) |
Examples of use
results <-estimate(modelName,data, precision=1e-15, marginal=TRUE, concentrated=TRUE, initialParameters=p )
results <-estimate(modelName,data )
compute
output
Creates a JD+ object of the class JD3_ProcResults
, which includes the model parameters, the value of the likelihood function and the first and second
moments of the latent variables conditional on the data
usage
compute(object,data, precision, marginal, concentrated)
Argument | Definition | Default | Remarks |
---|---|---|---|
object | state-space model belonging to JD3_SsfModel class | ||
data | data matrix (one time series per column, time series dimension on the rows) | the data can have missing values | |
precision | double indicating the largest likelihood deviations that make the algorithm stop | 1e-15 | |
marginal | logical value used to specify whether the marginal likelihood definition is used (TRUE) or not (FALSE) during the optimization | FALSE | The marginal likelihood is recommended when there is at least one variable that loads on a non-stationary latent variable and the loading coefficient needs to be estimated. In this situation, Francke et al. (2010) show that using the likelihood function might be misleading |
concentrated | logical value used to specify whether the likelihood is concentrated (TRUE) or not (FALSE) during the optimization | TRUE | The optimization algorithm used is different in each case |
Examples of use
results <-compute(modelName,data, precision=1e-15, marginal=TRUE, concentrated=TRUE )
results <-compute(modelName,data )