tarf_monte_carlo 3.23 → 3.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/tarf_monte_carlo/tarf_monte_carlo.c +5 -3
- data/lib/tarf_monte_carlo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 82676c437016c3396bd0732ee1d20db01a0d4fea1243b3a4555a3b746024874b
|
4
|
+
data.tar.gz: 774bf6b5cd0f5193c23477bd190aa88d538ae8f5977151e4129928ec13775354
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f51579af9e3911d5a23324af39aee42d877e7067d86cf2781889de751fb49fff7df31be62acc450aaed89c7bf85d3f0759c34fb94de6445c47f4392226623e3b
|
7
|
+
data.tar.gz: fdaff8bcd7ec29be4c0478cad38fe3469baea9ce657262c6e5422967968ccd7a463da96a477cc27bcc9906b5245a28707afac62cb4d1a93c29b9f73a51b25386
|
@@ -114,6 +114,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
114
114
|
double *CFs_array = ( double* ) malloc( NL * sizeof(double) );
|
115
115
|
double *LSts_array = ( double* ) malloc( NL * sizeof(double) );
|
116
116
|
double *USts_array = ( double* ) malloc( NL * sizeof(double) );
|
117
|
+
double *TempNs_array = ( double* ) malloc( NL * sizeof(double) );
|
117
118
|
|
118
119
|
VALUE Ls = rb_hash_aref(MCInputs, rb_str_new2("leverage_ratios") );
|
119
120
|
VALUE Ts = rb_hash_aref(MCInputs, rb_str_new2("expiration_times") );
|
@@ -135,6 +136,7 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
135
136
|
vs_array[leg] = NUM2DBL( rb_ary_entry(vs, leg) );
|
136
137
|
bs_array[leg] = NUM2DBL( rb_ary_entry(bs, leg) );
|
137
138
|
DFs_array[leg] = NUM2DBL( rb_ary_entry(DFs, leg) );
|
139
|
+
TempNs_array[leg] = *(Ns_array + leg);
|
138
140
|
}
|
139
141
|
// extra tarf structures
|
140
142
|
if ( KType == PIVOT_POINTS || KType == PIVOT_ABSOLUTE || KType == PIVOT_LEGS ) {
|
@@ -211,10 +213,10 @@ VALUE method_run_monte_carlo( VALUE self, VALUE args ) {
|
|
211
213
|
}
|
212
214
|
|
213
215
|
if (ConvertNotional == 1){
|
214
|
-
if(Spot < *( Ps_array + leg )){
|
215
|
-
Ns_array[leg] = *(
|
216
|
+
if(Spot < *( Ps_array + leg ) || Spot_dash < *( Ps_array + leg )){
|
217
|
+
Ns_array[leg] = *(TempNs_array + leg) / *( LSts_array + leg );
|
216
218
|
} else {
|
217
|
-
Ns_array[leg] = *(
|
219
|
+
Ns_array[leg] = *(TempNs_array + leg) / *( USts_array + leg );
|
218
220
|
}
|
219
221
|
}
|
220
222
|
|