def __init__(self, num_enbs, num_states, num_obs, A, B, V, W, P=None): super(EnsembleKalmanFilter, self).__init__(num_states, num_obs, A, B, V, W, P) self.weights = init_weights(num_enbs) self.num_enbs = num_enbs self.cov_type = None
def __init__(self, num_enbs, params): self.num_enbs = num_enbs super(EnsembleSIR, self).__init__(params) del self.alpha del self.beta self.current_Is = uniform(0, self.i * 2, num_enbs) self.current_Ss = ones(num_enbs) - self.current_Is self.alphas = uniform(0., 1, num_enbs) self.betas = uniform(0., 1, num_enbs) self.weights = [init_weights(num_enbs)] # matrix-like for i in range(num_enbs): if self.alphas[i] < self.betas[i]: self.alphas[i], self.betas[i] = self.betas[i], self.alphas[i] self.Is = [self.current_Is.tolist()] self.Ss = [self.current_Ss.tolist()]
def __init__(self, num_enbs, params): self.num_enbs = num_enbs super(ParticleSIR, self).__init__(params) del self.alpha del self.beta self.current_Is = uniform(0, self.i * 2, num_enbs) self.current_Ss = ones(num_enbs) - self.current_Is self.alphas = uniform(0., 1, num_enbs) self.betas = uniform(0., 1, num_enbs) self.weights = [init_weights(num_enbs)] # matrix-like for i in range(num_enbs): if self.alphas[i] < self.betas[i]: self.alphas[i], self.betas[i] = self.betas[i], self.alphas[i] self.Is = [self.current_Is.tolist()] self.Ss = [self.current_Ss.tolist()]
def __init__(self, num_enbs, params): self.num_enbs = num_enbs super(EnsembleAdjustmentSIR, self).__init__(params) del self.alpha del self.beta self.inflate = 1.001 self.current_Is = uniform(0, self.i * 2, num_enbs) self.current_Ss = ones(num_enbs) - self.current_Is self.alphas = uniform(0, .5, num_enbs) self.betas = uniform(0, .5, num_enbs) self.weights = [init_weights(num_enbs)] # matrix-like for i in range(num_enbs): if self.alphas[i] < self.betas[i]: self.alphas[i], self.betas[i] = self.betas[i], self.alphas[i] self.Is = [self.current_Is.tolist()] self.Ss = [self.current_Ss.tolist()]
def __init__(self, num_part, params={}): self.num_part = num_part self.weights = init_weights(num_part) self.x_prior = None