snotskie / EpistemicNetworkAnalysis.jl

Native implementation of Epistemic Network Analysis written in the Julia programming language. Based on rENA 0.2.0.1.
https://snotskie.github.io/EpistemicNetworkAnalysis.jl/
GNU General Public License v3.0
6 stars 2 forks source link

Missing weighted models #53

Open snotskie opened 10 months ago

snotskie commented 10 months ago

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

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

snotskie commented 10 months ago

I marked this consensus needed because I'm not clear/convinced on: