06-19-2020
Sasulee
Fluorite | Level 6
Member since
06-16-2020
- 9 Posts
- 0 Likes Given
- 0 Solutions
- 1 Likes Received
-
Latest posts by Sasulee
Subject Views Posted 2127 06-18-2020 06:54 PM 2198 06-18-2020 08:52 AM 2219 06-18-2020 08:31 AM 1062 06-18-2020 05:12 AM 1104 06-18-2020 03:28 AM 796 06-17-2020 08:39 AM 1451 06-16-2020 09:49 PM 1466 06-16-2020 06:59 PM 1547 06-16-2020 05:44 AM -
Activity Feed for Sasulee
- Got a Like for how to conduct vectorized summation in SAS/IML. 06-23-2020 04:46 PM
- Posted Re: how to conduct vectorized summation in SAS/IML on SAS/IML Software and Matrix Computations. 06-18-2020 06:54 PM
- Posted Re: how to conduct vectorized summation in SAS/IML on SAS/IML Software and Matrix Computations. 06-18-2020 08:52 AM
- Posted how to conduct vectorized summation in SAS/IML on SAS/IML Software and Matrix Computations. 06-18-2020 08:31 AM
- Posted Re: Add a label column as a vector or matrix based on condition on SAS/IML Software and Matrix Computations. 06-18-2020 05:12 AM
- Posted Add a label column as a vector or matrix based on condition on SAS/IML Software and Matrix Computations. 06-18-2020 03:28 AM
- Posted How to conduct calculation with conditions for target dataset rows? on SAS/IML Software and Matrix Computations. 06-17-2020 08:39 AM
- Tagged Re: ERROR: (execution) Matrices do not conform to the operation. on SAS/IML Software and Matrix Computations. 06-16-2020 09:50 PM
- Posted Re: ERROR: (execution) Matrices do not conform to the operation. on SAS/IML Software and Matrix Computations. 06-16-2020 09:49 PM
- Posted Re: ERROR: (execution) Matrices do not conform to the operation. on SAS/IML Software and Matrix Computations. 06-16-2020 06:59 PM
- Posted ERROR: (execution) Matrices do not conform to the operation. on SAS/IML Software and Matrix Computations. 06-16-2020 05:44 AM
-
My Liked Posts
Subject Likes Posted 1 06-18-2020 08:31 AM
06-18-2020
06:54 PM
Why r, t, Q should divide by 5, 10, 15 respectively? how can I express this when read all var?
... View more
06-18-2020
08:52 AM
Thanks for replying. However, every column is valued. Is it caused by incorrect use of the sum function?
... View more
06-18-2020
08:31 AM
1 Like
Hi all, I am building a formula which shows below by referring Sum a series in SAS When I run, start Sumcon(n);
i = 1:n; /* index of terms */
return( sum((deltak/k[i]##2)#exp(r[i]#T[i])#Q[i]) ); /* sum of terms */
finish;
n = T(1:68);
sum = j(nrow(n),1); /* allocate a vector for the results */
do k = 1 to nrow(n);
sum[k] = Sumcon( n[k] );
end; It returns ERROR: (execution) Matrix has not been set to a value. where the variables k, r, t, Q are all (68,1) vectors, the deltak is a fixed value 5. How can I achieve this formula? Thanks a lot.
... View more
06-18-2020
05:12 AM
Awesome, it works, thanks! however, how can I use this info to define another row? like create a new vector Q Q=p (a numeric variable ) if lab='put'; Q=c (a numeric variable ) if lab='call'; Q=(p+c)/2 if lab='mix'; The vector should be continuous, like p c lab Q 1 2 put 1 2 3 call 3 4 5 call 5 6 7 mix 6.5 Can you help?
... View more
06-18-2020
03:28 AM
Hi all, I have 3 data vectors read in iml which are I want to mark these data by following discipline: label = put where k<k0; label = call where k>k0; label = mix where k=k0. How can I do? Thank you!
... View more
06-17-2020
08:39 AM
Hi all, A basic question here. I have a VIX 2014 dataset, which is shown as: date tau K call_option_price S r put_option_price 2014/1/2 16 1735 98.6 1831.98 0.0018 2.175 2014/1/2 16 1740 93.9 1831.98 0.0018 2.175 2014/1/2 16 1745 88.85 1831.98 0.0018 2.525 2014/1/2 16 1750 84.05 1831.98 0.0018 2.6 2014/1/2 16 1755 79.4 1831.98 0.0018 2.825 ... 2014/1/2 36 1740 97.7 1831.98 0.0022 7.6 2014/1/2 36 1745 93.4 1831.98 0.0022 8.05 2014/1/2 36 1750 89 1831.98 0.0022 8.55 2014/1/2 36 1755 84.6 1831.98 0.0022 9.15 2014/1/2 36 1760 80.25 1831.98 0.0022 9.8 2014/1/2 36 1765 75.95 1831.98 0.0022 10.45 2014/1/2 36 1770 71.5 1831.98 0.0022 11.25 ... 2014/1/3 15 1735 97.25 1831.37 0.0018 1.625 2014/1/3 15 1740 92.6 1831.37 0.0018 1.775 2014/1/3 15 1745 87.5 1831.37 0.0018 1.925 2014/1/3 15 1750 82.65 1831.37 0.0018 1.925 2014/1/3 15 1755 77.8 1831.37 0.0018 2.25 2014/1/3 15 1760 73 1831.37 0.0018 2.45 2014/1/3 15 1765 68.45 1831.37 0.0018 2.75 2014/1/3 15 1770 63.75 1831.37 0.0018 3.05 2014/1/3 15 1775 59.05 1831.37 0.0018 3.375 2014/1/3 15 1780 54.25 1831.37 0.0018 3.7 ... 2014/1/3 35 1740 96.45 1831.37 0.0022 6.9 2014/1/3 35 1745 92.45 1831.37 0.0022 7.3 2014/1/3 35 1750 87.95 1831.37 0.0022 7.85 2014/1/3 35 1755 83.55 1831.37 0.0022 8.35 2014/1/3 35 1760 79.2 1831.37 0.0022 9 2014/1/3 35 1765 74.9 1831.37 0.0022 9.7 2014/1/3 35 1770 70.65 1831.37 0.0022 10.4 2014/1/3 35 1775 66.5 1831.37 0.0022 11.2 2014/1/3 35 1780 62.4 1831.37 0.0022 12.1 2014/1/3 35 1785 58.35 1831.37 0.0022 13.05 The data is imported by proc import. Just focus the variable 'tau', where is defined as the near-term expiration (T1) by tau=16 for 2014/1/2 and next-term expiration (T2) by tau=36 for 2014/1/2. Similarly, the T1 for 2014/1/3 is 15 and T2 for the same day is 35. The question is, how can I extract the T1 and T2 with corresponding other variables in the same row separately into two different tables or matrixes? and make it is available to conduct matrix calculation, such as i = 0 to n, Y = a*T1[ i ] * b*T2[ i ] (Just a simple example, I have to conduct a complex calculation then)? Thank you.
... View more
06-16-2020
09:49 PM
Yes it is. I have changed it to sqrt(). But why it returns following error when I perform sqrt() for this calculation. ERROR: (execution) Invalid argument to function. count : number of occurrences is 1437 operation : SQRT at line 93 column 13 operands : sigma_2 sigma_2 2531 rows 1 col (numeric) If I remove the sqrt() function, it works well.
... View more
06-16-2020
06:59 PM
It works. However, when I use this method to run the following syntax, it returns ERROR: Invocation of unresolved module SQR. sigma = sqr(2/T # sum(deltak/K) # exp(R # T) # Q-1/T # (F/K0-1) ## 2); where deltak is an Integer 5 and all the other variables are read in iml as elementwise I think. Is it caused by the incorrect use of sum function? The parameter k is a vector with n rows and 1 column. how can I achieve Summation[i] (deltak[i]/k[i]) correctly? Thanks.
... View more
06-16-2020
05:44 AM
When I run the code following proc iml;
start main;
varNames = {"tau" "K" "call_option_price" "S" "r" "put_option_price" "T" };
use cboe; * use the import data set;
read all var varNames; T = tau/365;
F = K + exp(r*T) * (call_option_price - put_option_price);
K0 = int(F);
finish; It returns ERROR: (execution) Matrices do not conform to the operation. where operation : * at line 89 column 14 operands : r, T r 2531 rows 1 col (numeric) T 2531 rows 1 col (numeric) I know the calculations should be conducted between matched matrixes. However, I found the variable r and T have the same structure with 2531 rows and 1 col.
... View more