Comments (10)
If you pull from master, you can try probability density plots. For example,
using SequentialSamplingModels
using Plots
dist = DiffusionRace(;ν=[1,2,3], k=.30, A=.70, τ=.20)
plot(dist)
You can overwrite the default settings by passing keyword arguments. The rt range uses Hick's law to identify the x max value. Its not perfect, but most of these models do not have a quantile function. In some cases, you will have to select your own range. Tomorrow I will look into a solution for the reflected plot. I'll also add a method using KDE for the simulation based models using traits. This seems like a good application for that technique.
from sequentialsamplingmodels.jl.
I like that idea. I think this is something that we can do in a separate package. Maybe SSMPlots.jl?
from sequentialsamplingmodels.jl.
Wouldn't it be overkill to have a dedicated package for, essentially, one function? Especially since I'm expecting the bulk of the code to be identical for most SSMs?
If your worry is the number of dependencies, wouldn't be addressed by optional soft dependencies, i.e., if the user has StatsPlots loaded then the function would work, if not, not? (that's just a wild guess as that's what we do in R or Python)
from sequentialsamplingmodels.jl.
Yeah. Bloat, increased dependencies, and increased load time is my concern. Julia recently introduced conditional loading which would allay may concerns for a small set of plots. I think if the number of plots becomes large, we can have a separate package.
What kind of plots and features do you think should be included? How should we display more than 3 distributions?
from sequentialsamplingmodels.jl.
Plot recipes might be useful too.
from sequentialsamplingmodels.jl.
I am really thinking of a very simple thing:
# Define generic internal plotting function
function _plot_ssm(distribution, xlim=(0, 3))
# Takes distribution, generate density lines (black lines from the example above)
# Plots choice 1 above choice 2 below
end
# Then define and export methods for each distribution
plot(distribution::LBA) = _plot_ssm
plot(distribution::DDM) = _plot_ssm
...
from sequentialsamplingmodels.jl.
Sounds good. I will take a look into some options later this week.
from sequentialsamplingmodels.jl.
Cool, very useful!
from sequentialsamplingmodels.jl.
I added methods for plot
, plot!
, histogram
, and histogram!
which work with all SSM models. Here is an example of each:
using SequentialSamplingModels
using Plots
dist = RDM(;ν=[1,2,3], k=.30, A=.70, τ=.20)
h = histogram(dist)
plot!(h, dist)
histogram(dist)
plot!(dist)
plot(dist)
histogram!(dist)
p = plot(dist)
histogram!(p, dist)
dist = LCA()
p = plot(dist; t_range=range(.3, 1.2, length=100))
histogram!(p, dist)
plot(dist; t_range=range(.3, 1.2, length=100))
histogram!(dist)
h = histogram(dist)
plot!(h, dist; t_range=range(.3, 1.2, length=100))
histogram(dist)
plot!(dist; t_range=range(.3, 1.2, length=100))
dist = Wald(ν=3.0, α=.5, τ=.130)
h = histogram(dist)
plot!(h, dist; t_range=range(.130, 1.0, length=100))
histogram(dist)
plot!(dist; t_range=range(.130, 1.0, length=100))
p = plot(dist; t_range=range(.130, 1.0, length=100))
histogram!(p, dist)
plot(dist; t_range=range(.130, 1.0, length=100))
histogram!(dist)
I decided against adding the reflected plot for the following reasons: (1) it adds complexity to the code, (2) it only works in the case of 2 options, and (3) the marginal benefit of a reflected plot over a standard plot is small (perhaps is easier to compare the height of the densities because they are closer together). It just didn't seem worth the hassle of coding and maintaining.
The next step I need to do is figure out how to get the new plotting methods to become accessible to the docs. Its not showing up for some reason.
from sequentialsamplingmodels.jl.
@DominiqueMakowski, by the way, I am moving the plotting functionality to SSMPlots.jl because the conditional loading was too finicky in my experience. I thought it was working, but it turned out to only be working locally because I had KernelDensity in my global environment. Tried many different configurations for a few hours, but nothing reliably worked. If it worked, it stopped working after I removed the package and reinstalled it. Julia imposes a three day waiting period before a new package can be registered. In the meantime, if you want to use it, you can add it as add https://github.com/itsdfish/SSMPlots.jl
.
from sequentialsamplingmodels.jl.
Related Issues (20)
- How to set up conditional parameters over the drift parameter in an LBA HOT 22
- patch release HOT 6
- Bijector error during data transformation in Turing HOT 5
- Estimating SSMs based on LANs HOT 2
- new release HOT 29
- Model Wishlist HOT 26
- Model assessment and indices of fit HOT 2
- LNR: vector of SDs HOT 1
- Testing ext across different machines HOT 1
- predict() broken? HOT 6
- LBA docs minor HOT 2
- Update version HOT 19
- Issue with pdf for WaldMixture HOT 5
- Increment Version HOT 23
- Simulating trial-level and hierarchical data HOT 10
- LNR model makes off-scale predictions for 1-choice data? HOT 7
- Minor docs: LBA args HOT 1
- Parametrizing RDM: "ERROR: DomainError with ..." log error HOT 4
- Standardize positional arguments for constructors.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sequentialsamplingmodels.jl.