Professional Documents
Culture Documents
demoSimetar-Sim.xls Page 9
A B C D E F G H I J K L M
448 3.9.3 Multivariate Normal Distribution in One Step
449 Covariance Matrix
450 Price 1 Price 2 Price 3 Prod 1 Prod 2 Prod 3
451 #NAME? 100.000 173.770 147.144 -8.980 -43.833 -190.314
452 #NAME? 400.000 244.734 -9.523 -183.525 -246.381
453 #NAME? 225.000 -12.938 -63.369 -304.910
454 #NAME? 9.000 39.829 63.377
455 #NAME? 625.000 425.693
456 #NAME? 1296.000
457 Array Function for
458 Assumed Means Correlated MVN Values Formulas for random numbers
459 Price 1 100.0 #NAME? =MVNORM(B459:B464,B451:G456)
460 Price 2 200.0 173.295 =MVNORM(B459:B464,B451:G456)
461 Price 3 250.0 243.692 =MVNORM(B459:B464,B451:G456)
462 Prod 1 25.0 27.465 =MVNORM(B459:B464,B451:G456)
463 Prod 2 190.0 187.008 =MVNORM(B459:B464,B451:G456)
464 Prod 3 260.0 289.534 =MVNORM(B459:B464,B451:G456)
465
466
467 3.9.4 Multivariate Normal Distribution Simulated in Two Steps
468 Correlation Matrix for 6 Random Variables
469 Price 1 Price 2 Price 3 Prod 1 Prod 2 Prod 3
470 Price 1 1 0.86884999796 0.98095796327 -0.2993458442 -0.1753334709 -0.528651155326
471 Price 2 0 1 0.81578132503 -0.1587216966 -0.3670505748 -0.342195571765
472 Price 3 0 0 1 -0.2875080178 -0.16898345 -0.564647896053
473 Prod 1 0 0 0 1 0.5310527664 0.5868265687507
474 Prod 2 0 0 0 0 1 0.4729917473762
475 Prod 3 0 0 0 0 0 1
476
477 Use CSND as an Array Function and let Simetar generate its own Independent SNDs
478 Vector of CSNDs Formulas used for the CSND random numbers
479 #NAME? =CSND(B470:G475)
480 1.202 =CSND(B470:G475)
481 2.628 =CSND(B470:G475)
482 -1.329 =CSND(B470:G475)
483 -1.315 =CSND(B470:G475)
484 -2.245 =CSND(B470:G475)
485
486 Second step in a Multivariate Normal Distribution is to use the CSNDs with Means and Standard Deviations
487 Variable Mean Std Dev CSND Random Value Formulas used for the random numbers
488 Price 1 100.0 10 #NAME? #NAME? =B488+C488*D488
489 Price 2 200.0 20 1.202 224.037 =B489+C489*D489
490 Price 3 250.0 15 2.628 289.418 =B490+C490*D490
491 Prod 1 25.0 3 -1.329 21.012 =B491+C491*D491
492 Prod 2 190.0 25 -1.315 157.123 =B492+C492*D492
493 Prod 3 260.0 36 -2.245 179.187 =B493+C493*D493
494
495
496 3.9.5 Multivariate Empirical Distribution in One Step
497 Historical Data for the Random Variables
498 Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
499 1 1.500 2.420 1.370 119.375 34.428 67.744
500 2 1.940 2.570 1.700 119.844 37.674 69.396
501 3 2.540 3.720 2.270 84.613 34.070 63.779
502 4 2.360 3.720 2.100 116.165 32.748 55.428
503 5 2.280 2.610 2.120 118.503 39.498 63.077
504 6 2.370 3.000 2.251 108.581 34.333 59.256
505 7 2.070 3.240 1.873 131.480 39.305 72.616
506 8 2.500 3.260 2.310 100.705 38.213 59.912
507 9 2.260 3.450 2.128 138.608 37.575 72.805
508 10 3.240 4.550 3.190 113.453 35.812 55.614
509 11 2.710 4.300 2.340 127.051 36.314 67.471
510 12 2.450 3.380 2.200 127.043 39.740 69.546
511 13 2.007 2.605 1.815 133.300 43.265 66.469
512
513 Variables One Step MVE Formulas used for the random numbers Vector of Means
514 0.11538461596 #NAME? =MVEMP(B499:G511,,,,F514:F519,1) 100.000
515 0.19230769575 184.878 200.000
516 0.26923078299 248.057 250.000
517 0.34615385532 28.309 25.000
518 0.42307692766 205.566 190.000
519 0.5 284.866 260.000
520 The last parameter in =MVEMP() is for the type of deviates to use
521 See the equation editor for the functions of this parameter 0, 1, 2, 3
522
523
524 3.9.6 Multivariate Empirical Distribution in Two Steps
525 First use EMP Icon to estimate parameters
526 Output for Empirical Distributions with 13 Observations as Percent Deviations from Mean
527 Unsorted Deviations from Mean
528 Obs. Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
529 1 -0.825 -0.874 -0.758 1.012 -2.724 2.890
530 2 -0.385 -0.724 -0.428 1.481 0.522 4.541
531 3 0.215 0.426 0.142 -33.751 -3.082 -1.076
532 4 0.035 0.426 -0.028 -2.198 -4.404 -9.427
533 5 -0.045 -0.684 -0.008 0.140 2.346 -1.778
534 6 0.045 -0.294 0.123 -9.782 -2.819 -5.598
535 7 -0.255 -0.054 -0.255 13.117 2.153 7.761
536 8 0.175 -0.034 0.182 -17.658 1.061 -4.943
537 9 -0.065 0.156 0.000 20.245 0.423 7.951
538 10 0.915 1.256 1.062 -4.910 -1.340 -9.241
539 11 0.385 1.006 0.212 8.688 -0.838 2.616
540 12 0.125 0.086 0.072 8.679 2.588 4.691
541 13 -0.318 -0.689 -0.313 14.937 6.113 1.614
542 Mean 2.325 3.294 2.128 118.363 37.152 64.855
543 St.Dev. 0.40023052772 0.63879181882 0.4083439502 13.9631927199 2.80845527527 5.6719650246649
544 C.V. 17.213054416 19.3910059853 19.1864679156 11.7969121579 7.55935301569 8.745632240467
545 Autocorrelation C 0.27654166954 0.40252620411 0.21235316742 -0.2620698868 0.07649437247 -0.374041610069
546
547 Unsorted Deviations from Mean as a Percent of Mean
548 Obs. Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
549 1 -0.3548822532 -0.26539080336 -0.35629116014 0.00854786931 -0.0733225195 0.0445536997483
550 2 -0.1656477142 -0.21985717547 -0.20123720602 0.01250892624 0.01405507168 0.0700201131561
551 3 0.09239938456 0.12923397169 0.0665832602 -0.2851442845 -0.0829489968 -0.016594636774
552 4 0.01498525495 0.12923397169 -0.0132930192 -0.0185741023 -0.1185328419 -0.145348748455
553 5 -0.0194210249 -0.2077148747 -0.00389580986 0.00118373917 0.06314686164 -0.027419007358
554 6 0.01928603992 -0.08932744219 0.05774988342 -0.0826444841 -0.0758687222 -0.086323543715
555 7 -0.1097375094 -0.01647363756 -0.11985737312 0.11082066943 0.057939537 0.1196688403211
556 8 0.07519624465 -0.01040248717 0.08537767888 -0.1491845254 0.02856803474 -0.076219635828
557 9 -0.0280225948 0.04727344149 -0.00013692612 0.17104207554 0.01137240257 0.1225906615808
558 10 0.39345433306 0.38118671269 0.49885488989 -0.0414837158 -0.036056912 -0.142484280658
559 11 0.1655127292 0.30529733287 0.0994734929 0.0734043728 -0.0225567104 0.0403409531374
demoSimetar-Sim.xls Page 10
A B C D E F G H I J K L M
560 12 0.05369231975 0.02602441514 0.03369302751 0.07332856238 0.06965893909 0.0723325770689
561 13 -0.1368152096 -0.2090834251 -0.14702073834 0.12619489738 0.16454585599 0.0248830077747
562
563 Correlation Matrix
564 Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
565 Var 1 1 0.86884999796 0.98095796327 -0.2993458442 -0.1753334709 -0.528651155326
566 Var 2 1 0.81578132503 -0.1587216966 -0.3670505748 -0.342195571765
567 Var 3 1 -0.2875080178 -0.16898345 -0.564647896053
568 Var 4 1 0.5310527664 0.5868265687507
569 Var 5 1 0.4729917473762
570 Var 6 1
571
572 Sorted Deviations from Mean as a Percent of Mean
573 F(x) Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
574 0 -0.3549177414 -0.26541734244 -0.35632678926 -0.285172799 -0.1185446952 -0.14536328333
575 0.03846153989 -0.3548822532 -0.26539080336 -0.35629116014 -0.2851442845 -0.1185328419 -0.145348748455
576 0.11538461596 -0.1656477142 -0.21985717547 -0.20123720602 -0.1491845254 -0.0829489968 -0.142484280658
577 0.19230769575 -0.1368152096 -0.2090834251 -0.14702073834 -0.0826444841 -0.0758687222 -0.086323543715
578 0.26923078299 -0.1097375094 -0.2077148747 -0.11985737312 -0.0414837158 -0.0733225195 -0.076219635828
579 0.34615385532 -0.0280225948 -0.08932744219 -0.0132930192 -0.0185741023 -0.036056912 -0.027419007358
580 0.42307692766 -0.0194210249 -0.01647363756 -0.00389580986 0.00118373917 -0.0225567104 -0.016594636774
581 0.5 0.01498525495 -0.01040248717 -0.00013692612 0.00854786931 0.01137240257 0.0248830077747
582 0.57692307234 0.01928603992 0.02602441514 0.03369302751 0.01250892624 0.01405507168 0.0403409531374
583 0.65384614468 0.05369231975 0.04727344149 0.05774988342 0.07332856238 0.02856803474 0.0445536997483
584 0.73076921701 0.07519624465 0.12923397169 0.0665832602 0.0734043728 0.057939537 0.0700201131561
585 0.80769228935 0.09239938456 0.12923397169 0.08537767888 0.11082066943 0.06314686164 0.0723325770689
586 0.88461536169 0.1655127292 0.30529733287 0.0994734929 0.12619489738 0.06965893909 0.1196688403211
587 0.96153843403 0.39345433306 0.38118671269 0.49885488989 0.17104207554 0.16454585599 0.1225906615808
588 1 0.39349367849 0.38122483136 0.49890477538 0.17105917975 0.16456231058 0.1226029206469
589
590 Now Your have to program the rest of the steps
591 Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
592 Vector CUSD #NAME? 0.95912822088 0.9103508376 0.27750717202 0.29358343145 0.2320555915152 =CUSD(B565:G570)
593 Forecast Means #NAME? #NAME? #NAME? #NAME? #NAME? #NAME? =TRANS(F514:F519)
594 Var 1 Var 2 Var 3 Var 4 Var 5 Var 6
595 Stoch Values #NAME? #NAME? #NAME? #NAME? #NAME? #NAME? =G593*(1+G592)
596
597
598 3.9.7 Multivariate Mixed Distribution
599 Correltation Matrix for four correlated random variables
600 Variable 1 Variable 2 Variable 3 Variable 4
601 Variable 1 1 0.86884999796 0.98095796327 -0.2993458442
602 Variable 2 0 1 0.81578132503 -0.1587216966
603 Variable 3 0 0 1 -0.2875080178
604 Variable 4 0 0 0 1
605
606 Generate a vector of CUSDs using the correlation matrix
607 Variable 1 #NAME? =CUSD(B601:E604)
608 Variable 2 0.4783
609 Variable 3 0.2875
610 Variable 4 0.7230
611
612 Parameters for the four distributions Min Mean/Middle Max
613 Variable 1 U(Min, Max, CUSD1) 10 20
614 Variable 2 Emp(Mean, Si, F(Si), CUSD2) 2.325
615 Variable 3 GRKS(Min, Middle, Max, CUSD3) 5 15 17
616 Variable 4 Beta(CUSD4, Alpha, Beta) 1.5 5
617 Si as a Fraction of the Mean for Empirical
618 Si values F(x) probabilities
619 -0.3549 0
620 -0.3549 0.03846153989 Mixed Multivariate Random Variables
621 -0.1656 0.11538461596 Random VariableRandom Numbers Formulas
622 -0.1368 0.19230769575 Variable 1 14.17032 =UNIFORM(D613,F613,B607)
623 -0.1097 0.26923078299 Variable 2 2.33727 =E614*(1+EMP(A619:A633,B619:B633,B608))
624 -0.0280 0.34615385532 Variable 3 12.19623 =GRKS(D615,E615,F615,B609)
625 -0.0194 0.42307692766 Variable 4 0.30848 =BETAINV(B610,D616,E616)
626 0.0150 0.5
627 0.0193 0.57692307234
628 0.0537 0.65384614468
629 0.0752 0.73076921701
630 0.0924 0.80769228935
631 0.1655 0.88461536169
632 0.3935 0.96153843403
633 0.3935 1
634
635
636 3.9.8 Generate Random Numbers Using the Multivariave Lognormal Distribution
637 Covariance Matrix
638 Mean Vector Price 1 Price 2 Price 3
639 14 #NAME? 16.000 -5.000 10.000
640 20 #NAME? 25.000 -9.000
641 17 #NAME? 49.000
642
643 Correlated
644 SND Array Random VariableRandom Numbers Formulas
645 -0.1440803496 MVLogNormal 1 #NAME? =MVLOGNORM(A639:A641,C639:E641,A645:A647,,1)
646 -1.5242694945 MVLogNormal 2 14.97560 Put in a 1 for moments to return normal numbers.
647 -1.0557626492 MVLogNormal 3 11.19115
648
649
650 3.3.9 Generate Random Numbers Using the Multivariate Student's t
651 Covariance Matrix
652 Mean Vector Price 1 Price 2 Price 3
653 14 Price 1 16.00 -5.00 10.00
654 20 Price 2 25.00 -9.00
655 17 Price 3 49.00
656
657 Degrees of Freedom 25
658 SNDs Correlated
659 -0.4450120796 Random VariableRandom Numbers Formulas
660 0.54633037463 MVStudent t 1 #NAME? =MVTINV(A653:A655,C653:E655,C657,A659:A661)
661 0.28684507005 MVStudent t 2 19.67978
662 MVStudent t 3 16.80538
663
664
665 3.9.10 Generate Random Numbers Using the Hotelling T-Squared Distribution
666 P dimension of covariance matrix 3.000
667 df Degrees of Freedom 25.000
668 Uniform Standard Deviate 0.143 Random Nos. Formulas
669 Hotelling T-Squared distribution Hotelling T Sq 1.687 =HOTELLTINV(C666,C667)
670 Hotelling T-Squared distribution with USD Hotelling T Sq 6.497 =HOTELLTINV(C666,C667,C668)
671
demoSimetar-Sim.xls Page 11
A B C D E F G H I J K L M
672
673 3.9.11 Generate Random Numbers Using the Wishart Distribution
674 Positive Definite Covariance Matrix
675 16 -5.000 10.000
676 25.000 -9.000
677 49.000
678 df Degrees of Freedom 25.000
679 Random Nos. Formulas
680 Wishart distribution #NAME? 7.5333864449 231.232673327 =WISHINV(A675:C677,C678)
681 7.533 416.910113179 -123.97861825
682 231.233 -123.97861825 716.671423498
683
684
685 3.9.12 Generate Random Numbers Using the Wilks Lambda Distribution
686 P dimension of Wishart matrix 3.000
687 N1 25.000
688 N2 50.000 Random Nos. Formulas
689 Wilks Lambda distribution Wilks Lambda 0.035 =WILKSLINV(C686,C687,C688)
690
691
692 3.9.13 Generate Random Numbers Using the Dirichlet Distribution
693 Alphas Array IUSDs Random Nos. Formulas
694 12 0.41027832031 Dirichlet 1 #NAME? =DIRICHINV(A694:A697,B694:B697)
695 13 0.23434448242 Dirichlet 2 0.22153815642 =DIRICHINV(A694:A697,B694:B697)
696 14 0.25595092773 Dirichlet 3 0.24576609148 =DIRICHINV(A694:A697,B694:B697)
697 15 0.40557861328 Dirichlet 4 0.29721814028 =DIRICHINV(A694:A697,B694:B697)
698
699
700 3.9.14 Uncorrelate Random Deviates -- CSND and CUSD
701 Price 1 Price 2 Price 3
702 Price 1 1 0.86884999796 0.98095796327
703 Price 2 0 1 0.81578132503
704 Price 3 0 0 1
705
706 Generate an array of CSNDs and an array of CUSDs, using an array of Independent Standard Normal Deviates
707 CSNDs CUSDs ISNDs
708 Price 1 #NAME? #NAME? -0.7662249165
709 Price 2 -0.7196153427 0.23588085689 -0.055028535
710 Price 3 -0.8431046317 0.19958491083 -0.8431046317
711 =CSND(B702:D704,F708:F710) =CUSD(B702:D704,F708:F710) =NORM()
712
713 Next Uncorrelate the CSNDs and CUSDs
714 Uncorr CSNDs Uncorr CUSDs
715 Price 1 #NAME? #NAME? These two arrays are the same as the starting
716 Price 2 #NAME? #NAME? array of ISNDs prior to the correlation.
717 Price 3 #NAME? #NAME?
718 =USND(B702:D704,B708:B710) =UUSD(B702:D704,D708:D710)
719
720
721 3.10 Iteration Counter in Simetar shows the iteration during simulation
722 Count of present iteration 1 =ITERATION()
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
demoSimetar-Sim.xls Page 12