-
Notifications
You must be signed in to change notification settings - Fork 2
/
Calibrated_Monte_Carlo_Study_test.R
1225 lines (963 loc) · 125 KB
/
Calibrated_Monte_Carlo_Study_test.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#require foreach and doparallel for parallel processing
if (!require("foreach")) install.packages("foreach")
library(foreach)
if (!require("doParallel")) install.packages("doParallel")
library(doParallel)
numCores <- detectCores()
#registering clusters, can set a smaller number using numCores-1
registerDoParallel(numCores)
#require randtoolbox for random number generations
if (!require("randtoolbox")) install.packages("randtoolbox")
library(randtoolbox)
#require Rfast for faster computation
if (!require("Rfast")) install.packages("Rfast")
library(Rfast)
if (!require("gnorm")) install.packages("gnorm")
library(gnorm)
if (!require("stats")) install.packages("stats")
library(stats)
if (!require("np")) install.packages("np")
library(np)
if (!require("nloptr")) install.packages("nloptr")
library(nloptr)
factdivide<-function(n1,n2){
decin1<-n1-floor(n1)
if(decin1==0){decin1=1}
decin2<-n2-floor(n2)
if(decin2==0){decin2=1}
n1seq<-seq(decin1,n1, by=1)
n2seq<-seq(decin2,n2,by=1)
all<-list(n1seq,n2seq)
maxlen <- max(lengths(all))
all2 <- as.data.frame(lapply(all, function(lst) c(lst, rep(1, maxlen - length(lst)))))
division<-all2[,1]/all2[,2]
answer<-exp(sum(log(division)))*(gamma(decin1)/gamma(decin2))
return(answer)
}
unbiasedsd<-function (x){
n<-length(x)
if(n==1){
return(1000000)
}
sd1<-sd(x)
if(n==2){
c1<-0.7978845608
}else if (n==3){
c1<-0.8862269255
}else if (n==4){
c1<-0.9213177319
}else{
c1<-sqrt(2/(n-1))*factdivide(n1=((n/2)-1),n2=(((n-1)/2)-1))
}
listall<-sd1*c1
(listall)
}
correctfactor<-function (n){
if(n==2){
c1<-0.7978845608
}else if (n==3){
c1<-0.8862269255
}else if (n==4){
c1<-0.9213177319
}else{
c1<-sqrt(2/(n-1))*factdivide(n1=((n/2)-1),n2=(((n-1)/2)-1))
}
listall<-c1
(listall)
}
#load the deterministic simulation functions of 9 common unimodal distributions
dsexp<-function (uni,location=1,scale=1) {
sample1<-qexp(uni,rate=scale)
sample1
}
dsRayleigh<-function (uni,location=1,scale=1) {
sample1 <- scale * sqrt(-2 * log((uni)))
sample1[scale <= 0] <- NaN
rev(sample1)
}
dsnorm<-function (uni,location=0,scale=1) {
sample1<-qnorm(uni,mean =location,sd=scale)
sample1
}
dsLaplace<-function (uni,location=0,scale=1) {
sample1<-location - sign(uni - 0.5) * scale * (log(2) + ifelse(uni < 0.5, log(uni), log1p(-uni)))
sample1
}
dslogis<-function (uni,location=0,scale=1) {
sample1<-qlogis(uni,location=location,scale=scale)
sample1
}
dsPareto<-function (uni,shape,scale=1) {
sample1 <- scale*((uni))^(-1/shape)
sample1[scale <= 0] <- NaN
sample1[shape <= 0] <- NaN
rev(sample1)
}
dslnorm<-function (uni,location=0,scale) {
sample1 <- qlnorm(uni,meanlog=location,sdlog = scale)
sample1
}
dsgamma<-function (uni,shape,scale = 1) {
sample1<-qgamma(uni,shape=shape,scale=scale)
sample1
}
dsWeibull<-function (uni,shape, scale = 1){
sample1<-qweibull(uni,shape=shape, scale = scale)
sample1
}
dsgnorm<-function (uni,location,shape, scale = 1){
sample1<-qgnorm(p=uni, mu = location, alpha = scale, beta = shape)
sample1
}
dsbeta<-function (uni,shape1,shape2) {
sample1<-qbeta(uni,shape1=shape1,shape2=shape2)
sample1
}
#moments for checking the accuracy of bootstrap
moments<-function (x){
n<-length(x)
m1<-mean(x)
var1<-(sum((x - m1)^2)/n)
tm1<-(sum((x - m1)^3)/n)
fm1<-(sum((x - m1)^4)/(n))
listall<-c(mean=m1,variance=var1,tm=tm1,fm=fm1)
(listall)
}
unbiasedmoments<-function (x){
n<-length(x)
m1<-mean(x)
var1<-sd(x)^2
var2<-(sum((x - m1)^2)/n)
tm1<-(sum((x - m1)^3)/n)*(n^2/((n-1)*(n-2)))
fm1<-(sum((x - m1)^4)/n)
ufm1<--3*var2^2*(2*n-3)*n/((n-1)*(n-2)*(n-3))+(n^2-2*n+3)*fm1*n/((n-1)*(n-2)*(n-3))
listall<-c(mean=m1,variance=var1,tm=tm1,fm=ufm1)
(listall)
}
standardizedmoments<-function (x){
n<-length(x)
m1<-mean(x)
var1<-sd(x)^2
var2<-(sum((x - m1)^2)/n)
tm1<-(sum((x - m1)^3)/n)*(n^2/((n-1)*(n-2)))
fm1<-(sum((x - m1)^4)/n)
ufm1<--3*var2^2*(2*n-3)*n/((n-1)*(n-2)*(n-3))+(n^2-2*n+3)*fm1*n/((n-1)*(n-2)*(n-3))
listall<-c(mean=m1,variance=var1,skewness=tm1/((var1)^(3/2)),kurtosis=ufm1/((var1)^(2)))
(listall)
}
biasedmoments_expected<-function (n,targetm,targetvar,targettm,targetfm){
m1<-targetm
var1=targetvar/(n/(n-1))
tm1<-targettm/(n^2/((n-1)*(n-2)))
fm1<-(targetfm+3*(targetvar/(n/(n-1)))^2*(2*n-3)*n/((n-1)*(n-2)*(n-3)))/((n^2-2*n+3)*n/((n-1)*(n-2)*(n-3)))
listall<-c(mean=m1,variance=var1,tm=tm1,fm=fm1)
(listall)
}
weighted_SE<-function(x,weights){
i <- !is.na(x)
weights <- weights[i]
x <- x[i]
n_eff1 <- (sum(weights))^2/(sum(weights^2))
wSE1<-sqrt((n_eff1/(n_eff1-1) * (sum(weights*(x-weighted.mean(x,weights))^2)/sum(weights)))/n_eff1)
return(wSE1)
}
weighted_SD<-function(x,weights){
i <- !is.na(x)
weights <- weights[i]
x <- x[i]
SD1 =sqrt(sum(weights*(x-weighted.mean(x,weights))^2)/sum(weights))
return(SD1)
}
random_sequences_process<-function(function1=NULL,expect1=NULL,expect2=NULL,samplesize=NULL,seed1=NULL){
dataframe_Gaussian<-c()
#first calculate the expected bias based on unbiased moments
Results1<-c(0,expect1)
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
dataframe_exp<-c()
Results1<-c(0,expect2)
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
set.seed(seed1)
ran1<-runif(length2)
uniran1<-c(ran1)
x<-dsnorm(uni=uniran1,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(1,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran1,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(1,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran2<-c(ran1)
x<-dsnorm(uni=uniran2,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(2,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran2,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(2,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran3<-c(ran1)
x<-dsnorm(uni=uniran3,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(3,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran3,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(3,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran4<-c(ran1)
x<-dsnorm(uni=uniran4,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(4,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran4,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(4,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran5<-c(ran1)
x<-dsnorm(uni=uniran5,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(5,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran5,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(5,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran6<-c(ran1)
x<-dsnorm(uni=uniran6,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(6,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran6,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(6,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran7<-c(ran1)
x<-dsnorm(uni=uniran7,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(7,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran7,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(7,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran8<-c(ran1)
x<-dsnorm(uni=uniran8,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(8,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran8,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(8,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran9<-c(ran1)
x<-dsnorm(uni=uniran9,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(9,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran9,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(9,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran10<-c(ran1)
x<-dsnorm(uni=uniran10,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(10,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran10,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(10,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran11<-c(ran1)
x<-dsnorm(uni=uniran11,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(11,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran11,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(11,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran12<-c(ran1)
x<-dsnorm(uni=uniran12,location = 0,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(12,function1(x=sortedx))
dataframe_Gaussian<-rbind(dataframe_Gaussian,Results1)
x<-dsexp(uni=uniran12,scale =1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(12,function1(x=sortedx))
dataframe_exp<-rbind(dataframe_exp,Results1)
dataframe1<-rbind(dataframe_Gaussian,dataframe_exp)
return(dataframe1)
}
distribution_sequences_process<-function(function1=NULL,disfunction=NULL,location1=NULL,scale1=NULL,samplesize=NULL,seed1=NULL){
dataframe_distribution1<-c()
length2<-samplesize
set.seed(seed1)
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(1,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(2,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(3,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(4,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(5,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(6,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(7,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(8,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(9,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(10,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(11,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
length2<-samplesize
ran1<-runif(length2)
uniran1<-c(ran1)
x<-disfunction(uni=uniran1,location = location1,scale =scale1)
sortedx<-Sort(x,descending=FALSE,partial=NULL,stable=FALSE,na.last=NULL)
Results1<-c(12,function1(x=sortedx))
dataframe_distribution1<-rbind(dataframe_distribution1,Results1)
return(dataframe_distribution1)
}
eval_f <- function(x){
return ((x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])^2+(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])^2+(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])^2+(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])^2+(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])^2+(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])^2+(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])^2+(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5])^2)
}
eval_grad_f <-function(x){
return(c(2*dataframe_Process[1,1]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,1]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,1]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,1]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,1]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,1]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,1]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,1]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,2]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,2]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,2]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,2]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,2]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,2]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,2]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,2]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,3]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,3]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,3]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,3]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,3]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,3]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,3]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,3]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,4]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,4]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,4]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,4]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,4]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,4]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,4]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,4]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,5]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,5]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,5]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,5]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,5]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,5]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,5]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,5]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,6]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,6]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,6]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,6]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,6]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,6]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,6]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,6]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,7]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,7]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,7]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,7]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,7]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,7]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,7]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,7]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,8]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,8]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,8]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,8]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,8]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,8]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,8]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,8]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,9]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,9]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,9]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,9]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,9]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,9]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,9]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,9]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,10]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,10]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,10]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,10]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,10]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,10]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,10]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,10]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,11]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,11]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,11]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,11]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,11]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,11]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,11]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,11]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5]),
2*dataframe_Process[1,12]*(x[1]*dataframe_Process[1,1]+x[2]*dataframe_Process[1,2]+x[3]*dataframe_Process[1,3]+x[4]*dataframe_Process[1,4]+
x[5]*dataframe_Process[1,5]+x[6]*dataframe_Process[1,6]+x[7]*dataframe_Process[1,7]+x[8]*dataframe_Process[1,8]
+x[9]*dataframe_Process[1,9]+x[10]*dataframe_Process[1,10]+x[11]*dataframe_Process[1,11]+x[12]*dataframe_Process[1,12]
-dataframe1[1,2])+2*dataframe_Process[2,12]*(x[1]*dataframe_Process[2,1]+x[2]*dataframe_Process[2,2]+x[3]*dataframe_Process[2,3]+x[4]*dataframe_Process[2,4]+
x[5]*dataframe_Process[2,5]+x[6]*dataframe_Process[2,6]+x[7]*dataframe_Process[2,7]+x[8]*dataframe_Process[2,8]
+x[9]*dataframe_Process[2,9]+x[10]*dataframe_Process[2,10]+x[11]*dataframe_Process[2,11]+x[12]*dataframe_Process[2,12]
-dataframe1[1,3])+2*dataframe_Process[3,12]*(x[1]*dataframe_Process[3,1]+x[2]*dataframe_Process[3,2]+x[3]*dataframe_Process[3,3]+x[4]*dataframe_Process[3,4]+
x[5]*dataframe_Process[3,5]+x[6]*dataframe_Process[3,6]+x[7]*dataframe_Process[3,7]+x[8]*dataframe_Process[3,8]
+x[9]*dataframe_Process[3,9]+x[10]*dataframe_Process[3,10]+x[11]*dataframe_Process[3,11]+x[12]*dataframe_Process[3,12]
-dataframe1[1,4])+2*dataframe_Process[4,12]*(x[1]*dataframe_Process[4,1]+x[2]*dataframe_Process[4,2]+x[3]*dataframe_Process[4,3]+x[4]*dataframe_Process[4,4]+
x[5]*dataframe_Process[4,5]+x[6]*dataframe_Process[4,6]+x[7]*dataframe_Process[4,7]+x[8]*dataframe_Process[4,8]
+x[9]*dataframe_Process[4,9]+x[10]*dataframe_Process[4,10]+x[11]*dataframe_Process[4,11]+x[12]*dataframe_Process[4,12]
-dataframe1[1,5])+2*dataframe_Process[5,12]*(x[1]*dataframe_Process[5,1]+x[2]*dataframe_Process[5,2]+x[3]*dataframe_Process[5,3]+x[4]*dataframe_Process[5,4]+
x[5]*dataframe_Process[5,5]+x[6]*dataframe_Process[5,6]+x[7]*dataframe_Process[5,7]+x[8]*dataframe_Process[5,8]
+x[9]*dataframe_Process[5,9]+x[10]*dataframe_Process[5,10]+x[11]*dataframe_Process[5,11]+x[12]*dataframe_Process[5,12]
-dataframe1[14,2])+2*dataframe_Process[6,12]*(x[1]*dataframe_Process[6,1]+x[2]*dataframe_Process[6,2]+x[3]*dataframe_Process[6,3]+x[4]*dataframe_Process[6,4]+
x[5]*dataframe_Process[6,5]+x[6]*dataframe_Process[6,6]+x[7]*dataframe_Process[6,7]+x[8]*dataframe_Process[6,8]
+x[9]*dataframe_Process[6,9]+x[10]*dataframe_Process[6,10]+x[11]*dataframe_Process[6,11]+x[12]*dataframe_Process[6,12]
-dataframe1[14,3])+2*dataframe_Process[7,12]*(x[1]*dataframe_Process[7,1]+x[2]*dataframe_Process[7,2]+x[3]*dataframe_Process[7,3]+x[4]*dataframe_Process[7,4]+
x[5]*dataframe_Process[7,5]+x[6]*dataframe_Process[7,6]+x[7]*dataframe_Process[7,7]+x[8]*dataframe_Process[7,8]
+x[9]*dataframe_Process[7,9]+x[10]*dataframe_Process[7,10]+x[11]*dataframe_Process[7,11]+x[12]*dataframe_Process[7,12]
-dataframe1[14,4])+2*dataframe_Process[8,12]*(x[1]*dataframe_Process[8,1]+x[2]*dataframe_Process[8,2]+x[3]*dataframe_Process[8,3]+x[4]*dataframe_Process[8,4]+
x[5]*dataframe_Process[8,5]+x[6]*dataframe_Process[8,6]+x[7]*dataframe_Process[8,7]+x[8]*dataframe_Process[8,8]
+x[9]*dataframe_Process[8,9]+x[10]*dataframe_Process[8,10]+x[11]*dataframe_Process[8,11]+x[12]*dataframe_Process[8,12]
-dataframe1[14,5])) )
}
eval_g_eq<-function(x){
constr<-c((1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]))^2)
grad<-c(-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10])),
-2*(1-(x[12]+x[11]+x[1]+x[2]+x[3]+x[4]+x[5]+x[6]+x[7]+x[8]+x[9]+x[10]))
)
return(list("constraints"=constr,"jacobian"=grad))
}
simulatedbatch_FSD_calibration<-foreach(batchnumber =c(c(seq(from=16, to=400, by=8),8*round(2^seq(from=6, to=10, by=0.18)))), .combine = 'rbind') %dopar% {
library(Rfast)
if (!require("foreach")) install.packages("foreach")
library(foreach)
if (!require("doParallel")) install.packages("doParallel")
library(doParallel)
#registering clusters, can set a smaller number using numCores-1
#require randtoolbox for random number generations
if (!require("randtoolbox")) install.packages("randtoolbox")
library(randtoolbox)
#require Rfast for faster computation
if (!require("Rfast")) install.packages("Rfast")
library(Rfast)
if (!require("gnorm")) install.packages("gnorm")
library(gnorm)
n <- batchnumber
samplesize=batchnumber
batchsize<-ceiling(500/sqrt(samplesize))
seed1=1
criteria<-1e-29
uniran<-c()
repeat{
dataframe1<-random_sequences_process(function1 = moments,expect1=biasedmoments_expected(n=samplesize,targetm=0,targetvar=1,targettm=0,targetfm=3),
expect2=biasedmoments_expected(n=samplesize,targetm=1,targetvar=1,targettm=2,targetfm=9),
samplesize=samplesize,seed1=seed1)
dataframe_Process<-t(cbind(dataframe1[2:13,2:5],dataframe1[15:26,2:5]))
x0<-rep(1,12)
lb<-rep(0,12)
ub<-rep(1,12)
opts <- list("algorithm"="NLOPT_LD_SLSQP",
"xtol_rel"=1.0e-10,"maxeval" = 1000)
library(nloptr)
results1 <- nloptr( x0=x0,
eval_f=eval_f,
lb=lb,
ub=ub,
eval_grad_f=eval_grad_f,
eval_g_eq=eval_g_eq,
opts=opts)
objective=results1$objective
weights=results1$solution
if(objective<criteria){
uniran<-rbind(uniran,c(samplesize=samplesize,seed1=seed1,objective=results1$objective,weights=results1$solution))
}
if (!is.null(nrow(uniran))){
if (nrow(uniran)==batchsize){
break
}}
seed1=seed1+1
}
uniran
}
simulatedbatch_FSD_calibration<-as.data.frame(simulatedbatch_FSD_calibration)
saveRDS(simulatedbatch_FSD_calibration, paste("Calibrated_Monte_Carlo_Gaussian_exp.Rds", sep = ","))
#test with the standard deviation of Gaussian distribution
simulatedbatch_Gaussian_calibrated_Monte_sd<-foreach(batchnumber =c(c(seq(from=16, to=400, by=8),8*round(2^seq(from=6, to=10, by=0.18)))), .combine = 'rbind') %dopar% {
library(Rfast)