# Run following simulation with large number of iterations?

Posted 1 year ago
1427 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 1 year ago
 What if you inserted a Print inside your Table that would show the calculated values that are about to be used in each iteration. If it makes progress until it gets to a particular set of values then you could see the data that is causing it to hang. That might help you track down the cause of the problem.