예제 #1
0
def _sample_inference():

    r = Inference(problem=_sample_problem(),
                  starting_parameters=[1, 2, 3, 4, 5, 6, 7],
                  starting_conditions=[1, 2, 3],
                  variable_parameters=['c_0', 'c_1'],
                  observed_trajectories=[
                      Trajectory([1, 2], [2, 3], Moment([1, 0, 0], 'x'))
                  ],
                  distance_function_type='gamma',
                  maxh=0.01)  # Some simulation kwargs
    return r
예제 #2
0
    def generate_inference_object(self):
        parameters = [0.001, 0.5, 330.0]
        initial_conditions = [320.0, 0]

        optimiser_method = 'sum_of_squares'
        variable_parameters = ['c_0', 'c_1', 'c_2', 'y_0']

        inference = Inference(self.dimer_problem,
                              parameters,
                              initial_conditions,
                              variable_parameters,
                              self.observed_trajectories,
                              distance_function_type=optimiser_method)
        return inference
예제 #3
0
        def check_initialisation(variable_parameters,
                                 expected_parameters_with_variability,
                                 expected_initial_conditions_with_variability,
                                 expected_constraints):
            p = Inference(
                self.dimer_problem, parameters, initial_conditions,
                variable_parameters,
                [Trajectory([1, 2, 3], [1, 2, 3], Moment([1], symbol='x'))])

            self.assertEquals(p.starting_parameters_with_variability,
                              expected_parameters_with_variability)
            self.assertEqual(p.starting_conditions_with_variability,
                             expected_initial_conditions_with_variability)
            self.assertEqual(p.constraints, expected_constraints)
예제 #4
0
    def generate_inference_object(self):
        parameters = [0.001, 0.5, 330.0]
        initial_conditions = [320.0, 0]

        optimiser_method = 'sum_of_squares'
        variable_parameters = ['c_0', 'c_1', 'c_2', 'y_0']

        inference = Inference(
            self.dimer_problem,
            parameters,
            initial_conditions,
            variable_parameters,
            # Only means trajectory
            [self.observed_trajectories[0]],
            distance_function_type=optimiser_method,
            # We need to increase rtol here, otherwise wildly different result happens
            rtol=1e-4)

        return inference
예제 #5
0
    def generate_inference_object(self):
        starting_params = [
            0.0008721146403084233, 0.34946447118966373, 285.8232870026351
        ]
        starting_conditions = [309.6216092798371, 0]

        optimiser_method = 'lognormal'
        variable_parameters = {
            'c_0': (0.0, 0.001),
            'c_1': (0.0, 0.5),
            'c_2': (260.0, 330.0),
            'y_0': (290.0, 320.0)
        }

        inference = Inference(
            self.dimer_problem,
            starting_params,
            starting_conditions,
            variable_parameters,
            # Only means trajectory
            [self.observed_trajectories[0]],
            distance_function_type=optimiser_method)
        return inference
예제 #6
0
    def generate_inference_object(self):
        starting_params = [
            0.0003553578523702354, 0.29734640303161364, 306.2260484701648
        ]
        starting_conditions = [304.7826314512718, 0]

        optimiser_method = 'normal'
        variable_parameters = {
            'c_0': (0.0, 0.001),
            'c_1': (0.0, 0.5),
            'c_2': (260.0, 330.0),
            'y_0': (290.0, 320.0)
        }

        inference = Inference(
            self.dimer_problem,
            starting_params,
            starting_conditions,
            variable_parameters,
            # Only means trajectory
            [self.observed_trajectories[0]],
            distance_function_type=optimiser_method)

        return inference