[R-SIG-Finance] Speed up for loop
Andreas Bregiannis
bregi@nni@@@ndre@@ @ending from hotm@il@com
Sun May 6 17:42:24 CEST 2018
Hello everyone,
I would like to ask you how I can speed up this for loop. In the following code I generate a sample of 200 of the NIG distribution and then I fit to them the NIG distribution. My aim is to estimate 1mln times the mean parameter of this NIG distribution.
Any ideas?
library(GeneralizedHyperbolic)
mu=0;delta = 1;alpha = 1;beta = 0
m=numeric(1000000)
for(i in 1:1000000){
m[i]=coef(nigFit(rnig(200, param = c(mu, delta, alpha, beta))
))[1]
}
Thank you in advance.
Best,
Andreas
[[alternative HTML version deleted]]
More information about the R-SIG-Finance
mailing list