@staticmethod<EOL><INDENT>def _check_grad_measurement_matrices(dM, state_dim, grad_params_no, measurement_dim, which = '<STR_LIT>'):<DEDENT>
if dM is None:<EOL><INDENT>if which == '<STR_LIT>':<EOL><INDENT>dM=np.zeros((measurement_dim ,state_dim,grad_params_no))<EOL><DEDENT>elif  which == '<STR_LIT>':<EOL><INDENT>dM=np.zeros((measurement_dim,measurement_dim,grad_params_no))<EOL><DEDENT><DEDENT>elif isinstance(dM, np.ndarray):<EOL><INDENT>if state_dim == <NUM_LIT:1>:<EOL><INDENT>if len(dM.shape) < <NUM_LIT:3>:<EOL><INDENT>dM.shape = (<NUM_LIT:1>,<NUM_LIT:1>,<NUM_LIT:1>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>if len(dM.shape) < <NUM_LIT:3>:<EOL><INDENT>if which == '<STR_LIT>':<EOL><INDENT>dM.shape = (measurement_dim,state_dim,<NUM_LIT:1>)<EOL><DEDENT>elif  which == '<STR_LIT>':<EOL><INDENT>dM.shape = (measurement_dim,measurement_dim,<NUM_LIT:1>)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>elif isinstance(dM, np.int):<EOL><INDENT>if state_dim > <NUM_LIT:1>:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>dM = np.ones((<NUM_LIT:1>,<NUM_LIT:1>,<NUM_LIT:1>)) * dM<EOL>
Function checks (mostly check dimensions) matrices for marginal likelihood
gradient parameters calculation. It check dH, dR matrices.

Input:
-------------
    dM: None, scaler or 3D matrix
        It is supposed to be
        (measurement_dim ,state_dim,grad_params_no) for "dH" matrix.
        (measurement_dim,measurement_dim,grad_params_no) for "dR"

        If None then zero matrix is assumed. If scalar then the function
        checks consistency with "state_dim" and "grad_params_no".

    state_dim: int
        State dimensionality

    grad_params_no: int
        How many parrameters of likelihood gradient in total.

    measurement_dim: int
        Dimensionality of measurements.

    which: string
        'dH' or 'dR'


Output:
--------------
    function of (k) which returns the parameters matrix.