# p-value for weighted Pearson correlation coefficient

I'm computing a weighted correlation coefficient, using the method described here.

I'd like to compute a p-value for the resulting r coefficient. How can I do this correctly, given that my r was computed using weights? Naturally, the standard formula for p-value of r (e.g., here) does not take weights into account, and I'm not sure how to properly account for weights when computing the p-value.

-

The $P$-value reported for a correlation depends on the sample correlation, the sample size, and a bundle of assumptions not always checked (independence being, in my experience, least checked of all). But there is a difference between a crude $t$-based $P$-value based on a null hypothesis of zero correlation and a more general $P$-value based on Fisher's $z$ transformation.
If getting really reliable $P$-values for weighted correlations is important to you, it is possible that you need to get a handle on it through simulation, including simulation of the weighting process if that is variable too.