# Run following simulation with large number of iterations?

Posted 11 months ago
1306 Views
|
3 Replies
|
0 Total Likes
|
 When I tried to run the following simulation for say 5 times, it runs successfully but when I tried to run it for 50 or 200 times it never terminates or produces results. I tried to limit the accuracy goal and precision goal in the 'FindDistributionParameters', it did not work. I thought that IntegerQ? needs to be inserted some place in the definition of the distribution very first line. I tried but that did not work either. Thanks. ClearAll[a0, d0] ExpoWeibull[sigma_, alpha_, theta_] := ProbabilityDistribution[ alpha theta/ sigma (1 - Exp[-(x/sigma)^alpha])^(theta - 1) Exp[-(x/sigma)^ alpha ]*(x/sigma)^(alpha - 1), {x, 0, Infinity}, Assumptions -> sigma > 0 && alpha > 0 && theta > 0]; DistributionParameterAssumptions[ExpoWeibull[sigma, alpha, theta]]; TruncatedEW[sigma_, alpha_, theta_, c_] := TruncatedDistribution[{c, \[Infinity]}, ExpoWeibull[sigma, alpha, theta]]; mydata = Sort[RandomVariate[ExpoWeibull[15, 2, 4], 50]]; myp = Values[ FindDistributionParameters[mydata, ExpoWeibull[a0, 2, d0]]]; myLeftCensoredData = Take[mydata, -40]; Table[myinitalParameters = Values[FindDistributionParameters[mydata, ExpoWeibull[a0, 2, d0]] // FullSimplify]; myTruncatedData := Sort[RandomVariate[ TruncatedDistribution[{0, Min[myLeftCensoredData]}, ExpoWeibull[myinitalParameters[[1]], 2, myinitalParameters[[2]]]], 10]]; myPseudoCompleteData := Join[myLeftCensoredData, myTruncatedData]; mydata = myPseudoCompleteData; myinitalParameters, {i, 1, 20}] 
3 Replies
Sort By:
Posted 11 months ago
 The code down to, but not including the Table, seems to work for any number of iterations.Perhaps you could manually do the same calculations that the Table would do, but one step at a time, and look carefully at the value of myData each time. I'm guessing the contents that is causing the problem.