def transition_prior(rank, val, vec, F, hyperparams):
    """
    Prior density for transition model parameters
    """
    Psi0 = rank * hyperparams['rPsi0']
    variancePrior = smp.singular_inverse_wishart_density(val, vec, Psi0)

    orthVec = complete_basis(vec)
    #    relaxEval = self.hyperparams['alpha']
    #    relaxEval = np.min(model.parameters['val'])
    relaxEval = np.max(val)
    rowVariance = np.dot(vec, np.dot(np.diag(val), vec.T)) \
                  + relaxEval*np.dot(orthVec,orthVec.T)
    matrixPrior = smp.matrix_normal_density(F, hyperparams['M0'], rowVariance,
                                            hyperparams['V0'])

    return variancePrior + matrixPrior
def transition_prior(rank, val, vec, F, hyperparams):
    """
    Prior density for transition model parameters
    """
    Psi0 = rank*hyperparams['rPsi0']
    variancePrior = smp.singular_inverse_wishart_density(val, vec, Psi0)

    orthVec = complete_basis(vec)
#    relaxEval = self.hyperparams['alpha']
#    relaxEval = np.min(model.parameters['val'])
    relaxEval = np.max(val)
    rowVariance = np.dot(vec, np.dot(np.diag(val), vec.T)) \
                  + relaxEval*np.dot(orthVec,orthVec.T)
    matrixPrior = smp.matrix_normal_density(F,
                                            hyperparams['M0'],
                                            rowVariance,
                                            hyperparams['V0'])

    return variancePrior + matrixPrior
Beispiel #3
0
    def transition_prior(self, model):
        """
        Prior density for transition model parameters
        """
        Psi0 = model.parameters['rank'][0] * self.hyperparams['rPsi0']
        variancePrior = smp.singular_inverse_wishart_density(
            model.parameters['val'], model.parameters['vec'], Psi0)

        orthVec = model.complete_basis()
        relaxEval = self.hyperparams['alpha']
        #        relaxEval = np.min(model.parameters['val'])
        #        relaxEval = np.max(model.parameters['val'])
        rowVariance = model.transition_covariance() \
                      + relaxEval*np.dot(orthVec,orthVec.T)
        matrixPrior = smp.matrix_normal_density(model.parameters['F'],
                                                self.hyperparams['M0'],
                                                rowVariance,
                                                self.hyperparams['V0'])

        return variancePrior + matrixPrior
    def transition_prior(self, model):
        """
        Prior density for transition model parameters
        """
        Psi0 = model.parameters['rank'][0]*self.hyperparams['rPsi0']
        variancePrior = smp.singular_inverse_wishart_density(
                                            model.parameters['val'],
                                            model.parameters['vec'],
                                            Psi0)

        orthVec = model.complete_basis()
        relaxEval = self.hyperparams['alpha']
#        relaxEval = np.min(model.parameters['val'])
#        relaxEval = np.max(model.parameters['val'])
        rowVariance = model.transition_covariance() \
                      + relaxEval*np.dot(orthVec,orthVec.T)
        matrixPrior = smp.matrix_normal_density(model.parameters['F'],
                                                self.hyperparams['M0'],
                                                rowVariance,
                                                self.hyperparams['V0'])

        return variancePrior + matrixPrior