Skip to content

Missing weighted models #53

@snotskie

Description

@snotskie

Weighted models are calculated as

image

image

image

that is, sum the weights of the ground lines, then multiply by the weights in the response line, then add to the weights of the response line multiplied with itself, then square or log the result.

$$\matrix{ A & B & C \\ .2 & 0 & 0 \\ .2 & 0 & 0 \\ .3 & .1 & 0 }$$

Here, we'd sum the ground lines, giving $p_A = .4$, so we'd get

  • $\theta_{AA} = .3 \times .4 = .12$, $\sqrt{\theta_{AA}} \approx .35$ (note, we don't count the $.3$ on the last line as connecting to itself, so we do not have $.3 \times .3$ as a term)
  • $\theta_{BA} = .1 \times .3 + .1 \times .4 = .07$, $\sqrt{\theta_{BA}} \approx .26$

this can be implemented by keeping a running sum of the conversation weights that, at the end of each line loop:

  1. adds the current response line to the running ground total
  2. accesses the row windowSize or so back by index (the row that is falling out of the window as this new line enters), and subtracts that row from the running ground total

This lets us handle things in linear time, assuming index look-up is constant time in DataFrames

Metadata

Metadata

Assignees

No one assigned

    Labels

    consensus neededFurther information is requestedenhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions