Example #1
0
    parameters[2, :] = lamb
    return parameters

def dInitDistribution(parameters):
    """ takes transformed parameters """
    xi_part = parameters[0] - 1 * exp(parameters[0])
    omega2_part = parameters[1] - 1 * exp(parameters[1])
    lamb_part = parameters[2] - 1 * exp(parameters[2])
    return xi_part + omega2_part + lamb_part




modeltheta = ParameterModel(name = "SV one-factor", dimension = 3)
modeltheta.setHyperparameters(hyperparameters)
modeltheta.setPriorlogdensity(logdprior)
modeltheta.setPriorgenerator(rprior)
modeltheta.setInitDistribution(rInitDistribution, dInitDistribution)
modeltheta.setParameterNames(["expression(xi)", "expression(omega^2)", "expression(lambda)"])
modeltheta.setTransformation(["log", "log", "log"])
modeltheta.priorandtruevaluesspecified = True
modeltheta.Rparameterstruevalues = "trueparameters <- c(0.5, 0.0625, 0.01)"
modeltheta.Rpriorfunctions = ["priorfunction <- function(x) dexp(x, rate = %.5f)" % hyperparameters["xi_rate"], \
                            "priorfunction <- function(x) dexp(x, rate = %.5f)" % hyperparameters["omega2_rate"], \
                            "priorfunction <- function(x) dexp(x, rate = %.5f)" % hyperparameters["lambda_rate"]]