Functions to specify the measurement equations

Functions required to specify the measurement equations: observables can be linked to specific elements of a block of states. The measurement equation can include lagged of the latent states, conditional expectations for those states, and linear combinations of them.

jd3_ssf_equation


output

Creates a JD+ object of the class JD3_SsfEquation

usage

jd3_ssf_equation(name,variance, fixed )

Argument Definition Default Remarks
name string refering to the name the user wants to give to the equation ex. "equation1", do not forget the commmas
variance double representing the value of $\sigma^2_{\epsilon}$, which is associated to the variance of the I.I.D. measurement error $ \epsilon_{t}$ 0 Note that $ var(\epsilon_{t}) =\sigma^2 \sigma^2_{\epsilon}$, so setting variance=2 implies that $ var(\epsilon_{t}) =\sigma^2 \times 2 $, where $ \sigma^2 $ is common to the variance of all shocks (including noise terms in the remaining measurement equations and transtion equation shocs)
fixed logical that triggers estimation of the variance $\sigma^2_{\epsilon}$ (FALSE) or fixes it (TRUE) to the value pre-specified by the input variance (zero by defaut) TRUE

Examples of use

eq1 <-jd3_ssf_equation("variableName")                                            
eq1 <-jd3_ssf_equation("variableName",variance=1, fixed = TRUE)   

jd3_ssf_loadings


output

Creates a JD+ object of the class JD3_SsfLoading

usage

jd3_ssf_loadings(pos, weights )

Argument Definition Default Remarks
pos double array defining the position of each one of the elements of the block of states defined Empty or Null indicates by default the first state included in the block (pos=0) For instance, the block of states generated with the jd3_ssf_ar2(...) function follows the following pattern: x(t-nlags), x(t-nlags+1),..., x(t),x(t+1|t),...,x(t+h|t), where p represents the number of lags selected and h stands for the forecast horizon selected. This means that in order to select x(t-nlags), one must specify pos=0. Alternatively, the contemporaneous and future values of the state (i.e. x(t),x(t+1|t),...,x(t+h|t)) are selected by specifying pos=c(nlags,nlags+1,...,nlags+h)
weights double array defining the weights associated to each one of the state variables included in the block Empty or Null By default, all the weights associated to the other argument, pos, will be equal to one. Otherwise, one can esily specify the weights as weights=c(w0,w1,...,wh), where wi are doubles. Make sure length(pos) is equal to length(weights)

Examples of use

 jd3_ssf_loadings(0) // this is called by default when the function is not applied
 jd3_ssf_loadings(c(4,3,2,1,0),c(1,0,0,-1)) // 

add


This function adds selected latent variables from the JD+ class JD3_SsfItem into the measurement equation of the model, which belongs to the JD+ class JD3_SsfEquation.

output

Modifies a JD+ object of the class JD3_SsfEquation

usage

add(object, item , coeff, fixed, loading)

Argument Definition Default Remarks
object JD3_SsfEquation object generated with the jd3_ssf_equation(name,variance,fixed) function
item JD3_SsfItem object representing a block of latent variables with dynamics given by a specific time-series model
coeff double setting the value of the coefficient associated to the block of latent variables defined by item 1 this coefficient defines the loadings specified in the last argument of the function
fixed logical that triggers estimation of coeff (FALSE) or fixes it (TRUE) to a pre-specified value TRUE
loading object of the class JD3_SsfLoading. Given that the JD3_SsfItem item contains a block of latent states, the loadings argument specifies the elements of the block are loaded in the equation and their weights Null defined by the jd3_ssf_loading(pos, weights)

Examples of use

add(eq1, "trend")                                         
add(eq1, "cycle")       
add(eq2, "trend2", 1.5, FALSE)       
add(eq2, "cycle2", 0.5, FALSE, jd3_ssf_loadings(4))       
add(eq3, "cycle2", 0.5, FALSE, jd3_ssf_loadings(c(4,3,2,1,0),c(1,0,0,-1))