def getYDensity(y, p1, p2, whichModel, v=0):
    if whichModel == 0:
        return util.gaussianDensity(y, 0, 1)
    elif whichModel == 1:
        return util.betaDensity(y, p1, p2)
    elif whichModel == 2:
        return util.gammaDensity(y, p2, p2)
    elif whichModel == 3:
        return util.gaussianDensity(y, 0, 1)
    elif whichModel == 4:
        return util.gaussianDensity(y, 0, 1)
    elif whichModel == 5:
        return util.weibullDensity(y, p1, p2)
    elif whichModel == 6:
        return util.gaussianDensity(y, 0, 1) * util.chi2Density(v, p2)
Esempio n. 2
0
def jointIntegrandT(g,w,p,q,myRho,nu):
    p1 = computeP_t(p,myRho,g,w,nu)
    p2 = computeP_t(q,myRho,g,w,nu)
    density1 = util.gaussianDensity(g,0,1)
    density2 = util.chi2Density(w,nu)    
    f = p1*p2*density1*density2
    return f
def logitProbitMoment(z, mu, sigma, momentNumber, isLogit):
    if isLogit == 1:
        v0 = (np.reciprocal(1 + np.exp(-(mu + sigma * z))))**momentNumber
    else:
        v0 = (norm.cdf(mu + sigma * z))**momentNumber
    density = util.gaussianDensity(z, 0, 1)
    f = v0 * density
    return f
Esempio n. 4
0
def jointIntegrandNVM(g,v,p,q,myRho,myA,invCdf,whichModel):
    p1 = computeP_NVM(p,myRho,g,v,myA,invCdf)
    p2 = computeP_NVM(q,myRho,g,v,myA,invCdf)
    density1 = util.gaussianDensity(g,0,1)
    if whichModel==0:
        density2 = util.gammaDensity(v,myA,myA)            
    elif whichModel==1:
        density2 = util.gigDensity(v,myA)    
    return p1*p2*density1*density2         
def thresholdMoment(g, w, p1, p2, myP, whichModel, myMoment, invCdf=0):
    d1 = util.gaussianDensity(g, 0, 1)
    if whichModel == 1:  # t
        d2 = util.chi2Density(w, p2)
        integrand = np.power(th.computeP_t(myP, p1, g, w, p2), myMoment)
    if whichModel == 2:  # Variance-gamma
        d2 = util.gammaDensity(w, p2, p2)
        integrand = np.power(th.computeP_NVM(myP, p1, g, w, p2, invCdf),
                             myMoment)
    if whichModel == 3:  # Generalized hyperbolic
        d2 = util.gigDensity(w, p2)
        integrand = np.power(th.computeP_NVM(myP, p1, g, w, p2, invCdf),
                             myMoment)
    return integrand * d1 * d2
def jointIntegrandRegion(g, p, q, rhoVec):
    p1 = th.computeP(p, rhoVec[0], g)
    p2 = th.computeP(q, rhoVec[1], g)
    density = util.gaussianDensity(g, 0, 1)
    f = p1 * p2 * density
    return f
def integrateGaussianMoment(g, r, myP, myMoment):
    integrand = np.power(th.computeP(myP, r, g), myMoment)
    return integrand * util.gaussianDensity(g, 0, 1)
def jointIntegrand(g, p, q, myRho):
    p1 = th.computeP(p, myRho, g)
    p2 = th.computeP(q, myRho, g)
    f = p1 * p2 * util.gaussianDensity(g, 0, 1)
    return f
def getCMF2r(g, myRho, pVec3, nVec3, kVec3):
    myF = getProdCMF(g, myRho, pVec3, nVec3, kVec3)
    return np.prod(myF) * util.gaussianDensity(g, 0, 1)
def getCMF(g, myRho, myP, myN, myK):
    pg = th.computeP(myP, myRho, g)
    f = util.getBC(myN, myK) * np.power(pg, myK) * np.power(1 - pg, myN - myK)
    cmf = f * util.gaussianDensity(g, 0, 1)
    return cmf
Esempio n. 11
0
def jointIntegrandG(g,p,q,myRho):
    p1 = computeP(p,myRho,g)
    p2 = computeP(q,myRho,g)
    density = util.gaussianDensity(g,0,1)
    f = p1*p2*density
    return f