Coder Social home page Coder Social logo

pythurstonian's People

Contributors

oscartgiles avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

awhug

pythurstonian's Issues

Working directly with Thurstonian utilities?

Hey Oscar!

This packages looks really cool. I've been playing around with it since yesterday, and am liking the functions. Just wanted to ask if/how one could go about working with Thurstonian latent utilities directly? Is this even possible?

I've tried your simulation using two within-subject conditions, with latent "beta" utility parameters corresponding to random samples from independent Gaussian distributions Condition 1 = [0.0, 1.0, 2.0], and Condition 2 = [0.0, 0.1, 0.2], where the variance of each is fixed to 1. Your results from the script in terms of permutations and Kendall's W are replicated perfectly, but when I dig into the posterior samples of the model, results seem odd.

If I'm following your code and previous discussions over at the Stan forum correctly, the z_hat parameter should correspond to the posterior draws of the Gaussians, fixing the first ranking at zero. The beta parameter forms the posterior difference of each ranking from the first (these relative differences appear to be the crux of PyThurstonian's modelling approach).

Working with the differences directly:

#Extract posterior samples per condition
C1_Beta = [myThurst.samples['beta'][i][0] for i in range(9999)] 
C2_Beta = [myThurst.samples['beta'][i][1] for i in range(9999)] 

#Find mean of differences from first rank per condition
np.array(C1_Beta).mean(axis = 0), np.array(C2_Beta).mean(axis = 0)

# Returns:  
(array([0.        , 1.00341984, 9.85625661]),
 array([0.        , 1.29277174, 1.44932662]))

This doesn't look quite right to me - are the differences relative to the first ranking within each condition really preserved accurately?

Why is the difference between the first and third object in Condition 1 blown out to this extent? Condition 2 results looks more accurate to our simulated data, but why are the differences centred on 1 and not 0? Finally, if the difference between the first and second rank in Condition 1 on the normal is ~1, and ~0.1 in Condition 2, why do they yield similar estimated differences between the conditions? Do the differences in latent scale dimensions not translate across conditions?

Just for reference, checking the variability of estimates in terms of the posterior distributions

pd.DataFrame(C1_Beta).loc[:,1:2].plot(kind='density')

image

pd.DataFrame(C2_Beta).loc[:,1:2].plot(kind='density')

image

I've tried a similar process for drawing directly from z_hat and the same broad pattern emerges.

Any guidance here?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.