문제

I have a vector of 365 shape parameters and a vector of 365 scale parameters from Weibull distribution.

How can I simulate 365 values from corresponding parameters in R?

The background of my question is: I have daily average wind speed which follows a Weibull distribution of unique parameters. Now, I would need to simulate daily wind speed from the data.

도움이 되었습니까?

해결책

Use the rweibull function. Btw, do you want just one simulated value per parameter pair?

Anyhow, this should do it for nobs number of observations. You can choose n=1 as well.

simulations <- mapply(rweibull, shapes, scales, MoreArgs=list(n=nobs))

where shapes is your vector containing the shape parameters, and similarly scales is the vector containing the scale parameter values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top