def __init__(self, vars, nObs, T, N, observed_jumps, model=None):
        # DES Temp:
        self.logp = []
        self.nObs = nObs
        self.T = T
        self.N = N
        self.zeroIndices = np.roll(self.T.cumsum(), 1)
        self.zeroIndices[0] = 0
        # self.max_obs = max_obs

        model = modelcontext(model)
        vars = inputvars(vars)
        shared = make_shared_replacements(vars, model)

        super(ForwardS, self).__init__(vars, shared)

        self.observed_jumps = observed_jumps
        step_sizes = np.sort(np.unique(observed_jumps))
        self.step_sizes = step_sizes = step_sizes[step_sizes > 0]

        pi = stick_breaking.backward(self.shared["pi_stickbreaking"])
        lower = model.free_RVs[1].distribution.dist.lower
        upper = model.free_RVs[1].distribution.dist.upper
        Q = rate_matrix_one_way(lower, upper).backward(self.shared["Q_ratematrixoneway"])
        B0 = logodds.backward(self.shared["B0_logodds"])
        B = logodds.backward(self.shared["B_logodds"])
        X = self.shared["X"]

        # at this point parameters are still symbolic so we
        # must create get_params function to actually evaluate them
        self.get_params = evaluate_symbolic_shared(pi, Q, B0, B, X)
예제 #2
0
def test_rate_matrix_one_way():
    check_matrix_transform_identity(ctrans.rate_matrix_one_way(0, 1),
                                    RateMatrixDomain)
def test_rate_matrix_one_way():
	check_matrix_transform_identity(ctrans.rate_matrix_one_way(0,1), RateMatrixDomain)