def totalcost(ph,r=0.03,tg=0.012,tp=0.004,eps=0.5,pc=3): # equation 4
    """
    Returns the total cost of owning a house given by equation (4).

    Arguments:
    ph:     price of house
    r:      interest rate (default 0.03)
    tg:     general tax rate (default 0.012)
    tp:     progressive tax rate (default 0.004)
    eps:    public value factor (default 0.5)
    pc:     price cutoff taxation (default 3)

    """
    pv = ph*eps # public assessment value, given by eq. (2)
    totalcost = r*ph+tg*pv+tp*max(pv-pc,0)
    return totalcost