有没有办法生成偏斜的随机变量强加一些定义的间隔?例如,FICO得分在500到800之间。这是我到目前为止的尝试:
set.seed(12345)
n=100
x <- c(1:n)
mu <- 600 + 100 * sin( x * pi / 24 )
e <- 100*rnorm( length(mu) )
y <- mu + e
plot( x, y )
lines( x, mu, col="red" )
legend('topleft',c('mu'),col=c('red'),lty=c(1,2),bty="n",cex=0.78)
但是,此代码会生成超出所需时间间隔的分数[500,800]。
由于