Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generic_imitation] different results depending on threshold notation #163

Open
leander-j opened this issue Dec 17, 2021 · 0 comments
Open
Assignees
Labels

Comments

@leander-j
Copy link

For a boolean variable, three different ways of setting (all) thresholds yield three different results:

  1. Specifying only for different source/target
    imi_abs_threshold = {'bool': {
                             ((False,), (True,)): 0,
                             ((True,), (False,)): 0}},
  1. Setting all others as well using the '*' notation
    imi_abs_threshold = {'bool': {
                             ((False,), (True,)): 0,
                             ((True,), (False,)): 0,
                             ('*', '*'): 0}},

same as

    imi_abs_threshold = {'bool': {
                                ((False,), (True,)): 0,
                                ((True,), (False,)): 0,
                                ((False,), (False,)): 0,
                                ((True,), (True,)): 0,
                                },
  1. Setting independently of source-target
    imi_abs_threshold = {'bool': 0},

same as

    imi_abs_threshold = {'bool': {
                                ('*', '*'): 0
                                }},

This qualitative finding is the same when using different values, e.g. 5 instead of 0. The same behavior is found in imi_rel_threshold.

The difference between 1. and 2. suggests that in the former it might not be allowed for a trait to keep its value if not specified (threshold set to ), which would be (in my opinion) counterintuitive. The difference of 2. and 3. is unclear to me.

Defaulting to (or 1.0 in the imi_rel_threshold case) is yet another question.

To reproduce:

culture = M.Culture(
    imi_rate = {
        'bool': 100,   # -> 10000 updates
        #'ord': 1000,  # *10 in batch -> 10000 updates
        #'pair': 20, # *~50 in batch -> 10000 updates
        '*': 0,
        },
    imi_type = 'complex',
    imi_batch_n = {'bool': 5, 'ord': 10},
    imi_p_in_batch = {'pair': 0.5},
    imi_network = M.Culture.acquaintance_network,
    imi_p_neighbor_drawn = {'bool': 0.5, 'pair': 1.0},
    imi_n_neighbors_drawn = {'ord': 5},
    imi_abs_threshold = {'bool': {
                                ((False,), (True,)): 5,
                                ((True,), (False,)): 5,
                                ('*', '*'): 5
                                },
            'ord': 1, 
            'pair': {
            ((('a','*'),), '*'): 0,
           # ('*', '*'): 0
        }},
    imi_include_own_trait = {'pair': True, '*': False},
    imi_delta = {'pair': 10.0},  # evaluation will be done by Individual.imi_evaluate_pair    
    imi_p_imitate = 1.0
    )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants