def derivativeZ(self,mLvl,pLvl,MedShk):
        '''
        Evaluate the derivative of consumption and medical care with respect to
        medical need shock at given levels of market resources, permanent income,
        and medical need shocks.

        Parameters
        ----------
        mLvl : np.array
            Market resource levels.
        pLvl : np.array
            Permanent income levels; should be same size as mLvl.
        MedShk : np.array
            Medical need shocks; should be same size as mLvl.

        Returns
        -------
        dcdShk : np.array
            Derivative of consumption with respect to medical need for each
            point in (xLvl,MedShk).
        dMeddShk : np.array
            Derivative of medical care with respect to medical need for each
            point in (xLvl,MedShk).
        '''
        xLvl = self.xFunc(mLvl,pLvl,MedShk)
        dxdShk = self.xFunc.derivativeZ(mLvl,pLvl,MedShk)
        dcdx = self.cFunc.derivativeX(xLvl,MedShk)
        dcdShk = dxdShk*dcdx + self.cFunc.derivativeY(xLvl,MedShk)
        dMeddShk = (dxdShk - dcdShk)/self.MedPrice
        return dcdShk,dMeddShk
def derivativeZ ( self , mLvl , pLvl , MedShk ) : xLvl = self . xFunc ( mLvl , pLvl , MedShk ) dxdShk = self . xFunc . derivativeZ ( mLvl , pLvl , MedShk ) dcdx = self . cFunc . derivativeX ( xLvl , MedShk ) dcdShk = dxdShk * dcdx + self . cFunc . derivativeY ( xLvl , MedShk ) dMeddShk = ( dxdShk - dcdShk ) / self . MedPrice return dcdShk , dMeddShk
Evaluate the derivative of consumption and medical care with respect to
        medical need shock at given levels of market resources, permanent income,
        and medical need shocks.

        Parameters
        ----------
        mLvl : np.array
            Market resource levels.
        pLvl : np.array
            Permanent income levels; should be same size as mLvl.
        MedShk : np.array
            Medical need shocks; should be same size as mLvl.

        Returns
        -------
        dcdShk : np.array
            Derivative of consumption with respect to medical need for each
            point in (xLvl,MedShk).
        dMeddShk : np.array
            Derivative of medical care with respect to medical need for each
            point in (xLvl,MedShk).