Yun-Xiao Li / ๆŽไบ‘็ฎซ's Avatar

Yun-Xiao Li / ๆŽไบ‘็ฎซ

@yunxiao-li.bsky.social

Name pronunced: yewn-shyao lee | PhD student in Psychology ๐Ÿ‘จ๐Ÿปโ€๐ŸŽ“| Drummer ๐Ÿฅ | Golden Age Mystery lover ๐Ÿ•ต๐Ÿปโ€โ™‚๏ธ

27 Followers  |  41 Following  |  10 Posts  |  Joined: 10.01.2025  |  2.8005

Latest posts by yunxiao-li.bsky.social on Bluesky

R code and output showing the new functionality:
``` r
## pak::pkg_install("quentingronau/bridgesampling#44")
## see: https://cran.r-project.org/web/packages/bridgesampling/vignettes/bridgesampling_example_stan.html
library(bridgesampling)

### generate data ###
set.seed(12345)
mu <- 0
tau2 <- 0.5
sigma2 <- 1
n <- 20
theta <- rnorm(n, mu, sqrt(tau2))
y <- rnorm(n, theta, sqrt(sigma2))

### set prior parameters ###
mu0 <- 0
tau20 <- 1
alpha <- 1
beta <- 1

stancodeH0 <- 'data {
  int<lower=1> n; // number of observations
  vector[n] y; // observations
  real<lower=0> alpha;
  real<lower=0> beta;
  real<lower=0> sigma2;
}
parameters {
  real<lower=0> tau2; // group-level variance
  vector[n] theta; // participant effects
}
model {
  target += inv_gamma_lpdf(tau2 | alpha, beta);
  target += normal_lpdf(theta | 0, sqrt(tau2));
  target += normal_lpdf(y | theta, sqrt(sigma2));
}
'
tf <- withr::local_tempfile(fileext = ".stan")
writeLines(stancodeH0, tf)
mod <- cmdstanr::cmdstan_model(tf, quiet = TRUE, force_recompile = TRUE)

fitH0 <- mod$sample(
  data = list(y = y, n = n,
              alpha = alpha,
              beta = beta,
              sigma2 = sigma2),
  seed = 202,
  chains = 4,
  parallel_chains = 4,
  iter_warmup = 1000,
  iter_sampling = 50000,
  refresh = 0
)
#> Running MCMC with 4 parallel chains...
#> 
#> Chain 3 finished in 0.8 seconds.
#> Chain 2 finished in 0.8 seconds.
#> Chain 4 finished in 0.8 seconds.
#> Chain 1 finished in 1.1 seconds.
#> 
#> All 4 chains finished successfully.
#> Mean chain execution time: 0.9 seconds.
#> Total execution time: 1.2 seconds.
H0.bridge <- bridge_sampler(fitH0, silent = TRUE)
print(H0.bridge)
#> Bridge sampling estimate of the log marginal likelihood: -37.73301
#> Estimate obtained in 8 iteration(s) via method "normal".

#### Expected output:
## Bridge sampling estimate of the log marginal likelihood: -37.53183
## Estimate obtained in 5 iteration(s) via method "normal".
```

R code and output showing the new functionality: ``` r ## pak::pkg_install("quentingronau/bridgesampling#44") ## see: https://cran.r-project.org/web/packages/bridgesampling/vignettes/bridgesampling_example_stan.html library(bridgesampling) ### generate data ### set.seed(12345) mu <- 0 tau2 <- 0.5 sigma2 <- 1 n <- 20 theta <- rnorm(n, mu, sqrt(tau2)) y <- rnorm(n, theta, sqrt(sigma2)) ### set prior parameters ### mu0 <- 0 tau20 <- 1 alpha <- 1 beta <- 1 stancodeH0 <- 'data { int<lower=1> n; // number of observations vector[n] y; // observations real<lower=0> alpha; real<lower=0> beta; real<lower=0> sigma2; } parameters { real<lower=0> tau2; // group-level variance vector[n] theta; // participant effects } model { target += inv_gamma_lpdf(tau2 | alpha, beta); target += normal_lpdf(theta | 0, sqrt(tau2)); target += normal_lpdf(y | theta, sqrt(sigma2)); } ' tf <- withr::local_tempfile(fileext = ".stan") writeLines(stancodeH0, tf) mod <- cmdstanr::cmdstan_model(tf, quiet = TRUE, force_recompile = TRUE) fitH0 <- mod$sample( data = list(y = y, n = n, alpha = alpha, beta = beta, sigma2 = sigma2), seed = 202, chains = 4, parallel_chains = 4, iter_warmup = 1000, iter_sampling = 50000, refresh = 0 ) #> Running MCMC with 4 parallel chains... #> #> Chain 3 finished in 0.8 seconds. #> Chain 2 finished in 0.8 seconds. #> Chain 4 finished in 0.8 seconds. #> Chain 1 finished in 1.1 seconds. #> #> All 4 chains finished successfully. #> Mean chain execution time: 0.9 seconds. #> Total execution time: 1.2 seconds. H0.bridge <- bridge_sampler(fitH0, silent = TRUE) print(H0.bridge) #> Bridge sampling estimate of the log marginal likelihood: -37.73301 #> Estimate obtained in 8 iteration(s) via method "normal". #### Expected output: ## Bridge sampling estimate of the log marginal likelihood: -37.53183 ## Estimate obtained in 5 iteration(s) via method "normal". ```

Exciting #rstats news for Bayesian model comparison: bridgesampling is finally ready to support cmdstanr, see screenshot. Help us by installing the development version of bridgesampling and letting us know if it works for your model(s): pak::pkg_install("quentingronau/bridgesampling#44")

02.09.2025 09:16 โ€” ๐Ÿ‘ 27    ๐Ÿ” 9    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 1

#rstats #statistics

I've released my new open source book, "Powered by Linear Algebra: the role of matrices and vector space in data science," at matloff.github.io/WackyLinearA....

Turns the classic LA course on its head! Still proves the theorems, but with a deep emphasis on applications.

15.08.2025 16:53 โ€” ๐Ÿ‘ 83    ๐Ÿ” 23    ๐Ÿ’ฌ 8    ๐Ÿ“Œ 5

Our lab has a list of papers that use statistical sampling algorithms like MCMC to explain human behaviour. Thanks to @lcastillo.bsky.social, you can select by behaviour or algorithm.

If we've missed any, please let us know!

sampling.warwick.ac....

16.05.2025 11:19 โ€” ๐Ÿ‘ 12    ๐Ÿ” 6    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

Had a great time working with Lucas and Adam on this preprint and the package! Let us know what you think!

21.05.2025 10:33 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Preview
Adults interpret iconicity in speech and gesture via the same modality-independent process - Psychonomic Bulletin & Review Iconicity is the resemblance or similarity between the form of a signal and its meaning. In two studies, we investigated whether adults interpret iconicity in speech and gesture via a modality-indepen...

Thrilled to see my first publication out in PB&R with @sotarokita.bsky.social and @suzanneaussems.bsky.social! Adults interpret novel verbs using iconic speed cues in speech prosody and hand gesture, with a small but reliable link across modalities.

Open access: link.springer.com/10.3758/s134...

13.05.2025 11:16 โ€” ๐Ÿ‘ 7    ๐Ÿ” 2    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 1

Congrats!๐ŸŽ‰

13.05.2025 18:38 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0
Ordinal Modeling

5 stars is better than 4 stars, but can we even define how much better it might be? Modeling ordinal outcomes like ratings is a subtle topic; fortunately I have a new chapter that dives directly into that nuance.

HTML: betanalpha.github.io/assets/chapt...
PDF: betanalpha.github.io/assets/chapt...

17.03.2025 13:58 โ€” ๐Ÿ‘ 28    ๐Ÿ” 6    ๐Ÿ’ฌ 2    ๐Ÿ“Œ 0

As a Chinese person, itโ€™s so exciting to see people from outside China engaging with the stories in Zhuang Zi! Your drawings are such a creative interpretationโ€”thank you for sharing this!

23.03.2025 22:46 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

New paper with Tong Liu and Arndt Broeder, just accepted in Cognition. We test novel qualitative predictions from sampling-based models of probability estimation in an event ranking task. Results provide evidence for the idea that mental sampling underlies probability judgements.

19.03.2025 21:38 โ€” ๐Ÿ‘ 29    ๐Ÿ” 9    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 1
Sage Journals: Discover world-class research Subscription and open access journals from Sage, the world's leading independent academic publisher.

"Noise in Cognition: Bug or Feature?" is now available in Perspectives on Psychological Science
doi.org/10.1177/1745... (1/4)

04.03.2025 22:33 โ€” ๐Ÿ‘ 17    ๐Ÿ” 9    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

(7/7) I want to express my gratitude to Johanna K. Falbรฉn, @lcastillo.bsky.social, Jake Spicer, Jian-Qiao Zhu, Cheng Stella Qian, Nick Chater, and @asanborn.bsky.social for their irreplaceable contribution to this project!

20.02.2025 18:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 0    ๐Ÿ“Œ 0

(6/7) In summary, our results suggest:

- ๐ŸŽ›๏ธ Adjustment for the assumption of uniform distortions by utility in probability representations;
- ๐ŸŽฏ Explicit repeated mental simulation could promote more accurate probability assessments in everyday life.

20.02.2025 18:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

(5/7) We analysed the data at both the group and individual levels and found:

- Group level: People are optimistic;
- Individual level: The majority remained unbiased; ๐Ÿคฏ
- People are optimistic if they can only do the task once;
- People start from a smaller or more probable value if repeated.

20.02.2025 18:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

(4/7) We manipulated the domains (gain, loss, or neutral), the outcome distributions (equally or unequally distributed), the numbers of outcomes (two, six, or eleven), the repetition of the task (one-off or repeatedly), and the task instructions (imagine, predict, judge the probability).

20.02.2025 18:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

(3/7) To investigate the mental simulation process, we employed a method called random generation. In this method, participants are asked to imagine playing a gamble and then utter the imagined outcome.

20.02.2025 18:42 โ€” ๐Ÿ‘ 0    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
Post image

(2/7) People often simulate uncertain events in their heads to assess risk, but do the values of the possible outcomes distort these simulations? Prior experimental findings offer conflicting predictions about how utility may bias this mental sampling process.

20.02.2025 18:42 โ€” ๐Ÿ‘ 1    ๐Ÿ” 0    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
OSF

๐Ÿšจ A new preprint is out!

How does utility influence mental simulations of risky events? ๐Ÿค”๐ŸŽฒ

We tested this across 4 experiments & found that most people simulate probabilities accurately, but biases emerge in key conditions!

If you want to learn more, keep reading!
doi.org/10.31234/osf...

20.02.2025 18:42 โ€” ๐Ÿ‘ 6    ๐Ÿ” 5    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0
OSF

New Preprint Out! ๐Ÿš€๐Ÿš€
Can people generate a random sequence if given enough time?

Keep reading if
- You make cognitive models with randomness in them
- You like to explore the world, be creative, choose well
- You want protection from clever agents exploiting patterns in your behavior.
osf.io/awg9j

20.02.2025 11:14 โ€” ๐Ÿ‘ 8    ๐Ÿ” 4    ๐Ÿ’ฌ 1    ๐Ÿ“Œ 0

@yunxiao-li is following 19 prominent accounts