Constructor
new ClockInference(parent, bc, past_data)
- Source:
Properties:
Name | Type | Description |
---|---|---|
kde |
KernelDensityEstimation | The instance of the |
clocks_li |
Array.<number> | Array of all the active clocks on the screen. |
cscores |
Array.<number> | Array of scores for the likelihood that the user intended to choose a particular clock at the current round of selection, for all clocks on the screen. This is a list of scores for only the current round of selection. |
clock_history |
Array.<Array.<number>> | 2D Array where each sub-array lists the relative angles around each clock at the
click times so far. For example, if the user has clicked twice so far, |
clock_locs |
Array.<number> | The relative angles around each clock at the press times only
for the most recent press. It is equivalent to |
Parameters:
Name | Type | Description |
---|---|---|
parent |
Keyboard | The instance of the main |
bc |
BroderClocks | The instance of the |
past_data |
Object | null | Object containing previous data from the KDE from the prior session, if no past data then null. Details in the |
Methods
get_score_inc(yin) → {number}
- Description:
Calculates the likelihood that a clock will be chosen, given the relative click angle around that clock. Note that the input is the click time converted into the relative angle around the clock, not the actual click time itself.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
yin |
number | The relative click time in seconds |
Returns:
- returns the likelihood that a clock will be chosen.
- Type
- number
handicap_cscores(is_win, is_start)
- Description:
If the highest scoring clock is above a certain threshold, force the highest score to be that threshold.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
is_win |
boolean | Was the top-score clock selected in the current round. |
is_start |
boolean | Is this the first round before any clicks. |
inc_score_inc(yin)
- Description:
Note that the density calculation only involves the most recent n hist samples. When a new yin comes in, decide if we need to throw away any old yin in
y_list
(anything pastn_hist
), and callincrement_dens()
. Also updateksigma
calculation.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
yin |
number | The relative click time in seconds. |
is_winner() → {boolean}
- Description:
Determine if the highest-probability clock is the winner and should be selected. if its posterior probability is higher than 1−P(error) (There is a winner iff this is met). Refer to page 17, section “Selection Decisions” of Prof. Broderick’s Nomon Tech Report for more detail.
- Source:
Returns:
- Whether the top-score clock should be selected.
- Type
- boolean
learn_scores(is_undo)
- Description:
While this function has a very similar name with update scores, they serve quite different functionalities. Instead of doing something directly related with scores, this function updates all history-related attributes, such as
win_history
,clock_history
, and callsinc_score_inc()
.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
is_undo |
boolean | Whether the previously selected clock was undo. |
reverse_index_gsi(log_dens_val) → {*}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
log_dens_val |
Returns:
- Type
- *
update_dens(new_time_rotate)
- Description:
Update the histogram (
kde.dens_li
) if the rotation period changes. Note that this function is only used when the rotation period changes, and thekde.dens_li
when a new press time comes in happens atinc_score_inc()
.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
new_time_rotate |
number | The new clock rotation period in seconds. |
update_history(time_diff_in)
- Description:
Given a new click time, update clock_history.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
time_diff_in |
number | The relative click time in seconds. |
update_scores(time_diff_in)
- Description:
Update the posterior estimates for the clocks (
cscores
) every time a yin comes in.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
time_diff_in |
number | The relative click time in seconds. |
update_sorted_inds()
- Description:
Updates the list of clocks sorted by highest cscore (the largest posterior probability).
- Source: