Пример #1
0
def inf2():

    #non-pest
    from pyemu.mat import mat_handler as mhand
    from pyemu.pst import Pst
    from pyemu import Influence
    import numpy as np

    inpst = Pst(
        os.path.join("..", "verification", "Freyberg", "Freyberg_pp",
                     "freyberg_pp.pst"))

    pnames = inpst.par_names
    onames = inpst.obs_names
    npar = inpst.npar
    nobs = inpst.nobs
    j_arr = np.random.random((nobs, npar))
    parcov = mhand.Cov(x=np.eye(npar), names=pnames)
    obscov = mhand.Cov(x=np.eye(nobs), names=onames)
    jco = mhand.Jco.from_binary(inpst.filename.replace(".pst", ".jcb"))
    resf = inpst.filename.replace(".pst", ".rei")
    s = Influence(jco=jco, obscov=obscov, pst=inpst, resfile=resf)
    print(s.hat)
    print(s.observation_leverage)
    #v = s.studentized_res
    print(s.estimated_err_var)
    print(s.studentized_res)
Пример #2
0
    def test():
        #non-pest
        from pyemu.mat import mat_handler as mhand
        from pyemu.pst import Pst
        import numpy as np

        inpst = Pst('../verification/Freyberg/Freyberg_pp/freyberg_pp.pst')

        pnames = inpst.par_names
        onames = inpst.obs_names
        npar = inpst.npar
        nobs = inpst.nobs
        j_arr = np.random.random((nobs, npar))
        parcov = mhand.Cov(x=np.eye(npar), names=pnames)
        obscov = mhand.Cov(x=np.eye(nobs), names=onames)
        jco = mhand.Jco.from_binary(
            '../verification/Freyberg/freyberg_pp/freyberg_pp.jcb')
        resf = '../verification/Freyberg/freyberg_pp/freyberg_pp.rei'
        s = Influence(jco=jco, obscov=obscov, pst=inpst, resfile=resf)
        print(s.hat)
        print(s.observation_leverage)
        #v = s.studentized_res
        print(s.estimated_err_var)
        print(s.studentized_res)