I'm using the distr package in R for a research project that involves the convolution of multiple i.i.d. uniform random variables.
The details of the project are not important, but sometimes the min and max of the distributions are very close to each other, like .999 and 1. This is a valid continuous random variable, and I can create the abstract distribution using Unif(.999,1) without trouble.
But when I try to use the convpow function to get the convolution of two or more of these random variables, I get the error "Error in xy.coords(x, y, setLab = FALSE) : 'x' and 'y' lengths differ."
I can't figure out anything that would cause this. My question is two-fold: 1. Am I making a mistake and if so, how can I fix it? 2. If there is something in the package that's causing this, is there a related package that I could use that won't have this issue?
The convpow function works just fine when I use it with bounds that aren't so close together, but for some reason it doesn't work when the boundaries are very close.
library(distr)
z <- Unif(.999,1)
conv_z <- convpow(z, 2)