[R-SIG-Finance] [R-sig-finance] Surface plot of multivariate time series

megh megh700004 at yahoo.com
Sun Sep 13 21:09:38 CEST 2009


Hi, I wanted to get a surface plot of following data (please see the
attachment as well)

06-01-2003	106.7332	113.665	116.5693	117.0284	117.1408	118.1717	119.9737
121.4082	121.3087	118.6427
07-01-2003	106.2834	111.4758	113.8203	114.421	114.6729	115.4357	116.7971
118.4125	119.943	121.0723
08-01-2003	108.942	111.7029	113.1008	113.7205	114.1928	115.141	116.7391
118.3573	119.3991	119.3241
09-01-2003	110.4675	113.2026	114.6338	115.3628	116.0853	117.2171	118.7373
120.2737	121.4736	122.0005
10-01-2003	109.4487	112.5962	114.3684	115.3881	116.4354	117.6378	118.8489
120.1786	121.7057	123.4923
14-01-2003	108.6345	111.6306	113.17	113.9849	114.8858	116.099	117.5972
119.3401	121.2892	123.405
15-01-2003	109.3081	111.9351	113.4392	114.4832	115.7795	117.3387	118.9702
120.5164	121.7997	122.6339
16-01-2003	108.8797	111.8276	113.1078	113.7528	114.8229	116.1417	117.5111
118.9683	120.4773	121.9874
17-01-2003	108.8164	110.8753	111.9389	112.6866	113.7571	114.7225	115.7346
117.4464	120.3864	125.1369
20-01-2003	111.0869	111.7453	111.7856	112.0879	113.195	114.1069	115.0907
116.9625	120.339	125.9243
21-01-2003	109.3528	111.118	111.6719	112.2673	113.6269	114.5619	115.5616
117.7047	121.847	129.0104
22-01-2003	109.4875	112.4725	113.4062	113.837	114.8819	116.1567	117.4217
118.5088	119.1914	119.2376
23-01-2003	109.7985	112.5286	113.235	113.7125	115.0282	116.3633	117.5139
118.4218	118.9089	118.7916
24-01-2003	109.5703	112.1044	112.4529	112.8908	114.393	115.489	116.6935
118.848	122.5627	128.5533
27-01-2003	102.9	109.7752	110.6848	111.302	113.4287	114.4952	115.6115
118.0155	122.6145	130.5326
28-01-2003	113.6774	111.2344	111.4797	113.292	115.138	116.0558	117.5501
119.2964	119.9029	118.4434
29-01-2003	113.2998	112.0985	112.754	114.5099	116.3476	117.6464	119.1492
120.7744	122.0346	122.6313
30-01-2003	113.7105	112.5954	113.3105	115.1203	117.0652	118.5727	120.1488
121.7213	122.9854	123.76
31-01-2003	110.3978	111.2982	112.8093	114.6619	116.3874	117.8985	119.8401
121.6789	122.5285	121.7121
03-02-2003	110.8484	113.2196	115.2325	117.0499	118.7443	120.7044	123.3587
125.2696	124.7541	120.4981
04-02-2003	111.206	113.6112	115.4636	117.0565	118.7946	120.8104	122.8482
124.4681	125.2035	124.6097
05-02-2003	115.5131	115.3867	116.7003	118.755	120.6245	122.07	123.5158
125.0743	126.8618	129.0437
06-02-2003	114.1132	115.3722	116.997	118.8211	120.6517	122.3541	123.9498
125.76	128.1162	131.3473
07-02-2003	112.9725	113.7632	115.2758	117.1311	118.794	120.3272	122.0943
123.9581	125.8084	127.5801
10-02-2003	110.7507	112.9335	114.5976	116.0416	117.6323	119.3914	121.2422
123.2691	125.5359	128.0989
12-02-2003	114.9253	116.8515	118.5538	120.1583	121.8057	123.5481	125.4166
127.4646	129.7449	132.3131
13-02-2003	116.2652	118.1099	119.845	121.762	124.2354	126.0825	126.9981
128.43	131.4719	137.256
14-02-2003	121.5586	122.3633	123.9336	125.8792	127.7922	129.0673	129.818
130.9707	133.2704	137.4908
17-02-2003	122.1714	123.4488	125.1908	126.9153	128.1863	129.1394	130.0936
131.4163	133.4777	136.6784
18-02-2003	119.9327	121.3249	123.4461	125.3816	126.4514	127.5428	128.7956
129.7536	130.1897	129.9015
19-02-2003	119.9151	120.9785	123.2676	125.6381	127.1563	128.093	128.6919
129.0927	129.4891	130.0813
20-02-2003	121.8981	123.3143	125.216	127.2039	128.8592	129.8329	130.4769
131.4318	133.2197	136.3925
21-02-2003	126.3064	127.444	129.2906	131.2926	132.9207	133.8624	134.5098
135.4903	137.3237	140.5623
24-02-2003	123.8	126.5513	128.8436	130.6382	131.9878	133.0892	134.1179
135.2494	136.6713	138.5806
25-02-2003	120.8692	123.5053	125.6099	127.2776	128.5475	129.5115	130.7823
132.2426	133.2272	133.2312
26-02-2003	119.3011	120.3103	121.8103	123.544	125.1926	126.4681	127.474
128.3516	129.2104	130.1765
27-02-2003	118.2955	120.5642	122.3673	123.8429	125.1513	126.4479	127.7845
128.9628	129.6794	129.667
28-02-2003	116.5928	119.5929	121.701	123.1976	124.5193	125.9342	126.9174
127.7501	129.0824	131.4297
03-03-2003	119.8868	121.4168	123.1731	124.906	126.236	127.0385	127.8073
128.6333	129.5156	130.5212
04-03-2003	118.764	119.6763	121.4047	123.3589	124.6016	124.9803	125.8121
126.938	127.957	128.6696
05-03-2003	125.1824	124.1091	125.2075	127.309	128.7892	129.2025	130.0101
130.9591	131.6002	131.7049
06-03-2003	124.0596	125.5667	127.6494	129.7132	130.8301	131.0106	131.4698
132.1812	133.0396	134.0884
07-03-2003	128.4414	130.7267	132.7911	134.265	134.5203	133.8361	133.4276
133.5263	134.3459	136.2228
10-03-2003	129.0602	132.5002	134.8355	135.9293	135.4292	134.2905	133.9001
134.1221	134.9415	136.478
11-03-2003	129.8975	133.2684	135.1841	135.8085	135.2414	134.263	133.7314
133.6907	134.272	135.678
12-03-2003	128.7272	130.9118	132.3165	132.9118	132.6072	131.8662	131.3247
131.2672	132.0263	133.9792
13-03-2003	129.6239	131.9765	133.4767	134.0539	133.5456	132.774	132.5958
133.0634	134.3645	136.7611
14-03-2003	132.6888	133.8677	134.7423	135.0664	134.5172	133.7007	133.2976
133.4486	134.3983	136.4424
17-03-2003	129.3289	129.9013	130.6636	131.4042	131.9068	131.9803	131.7663
131.6678	132.0203	133.1536
18-03-2003	127.1546	129.1919	130.3414	130.7845	130.7077	130.023	129.3162
129.7046	132.179	137.8575
19-03-2003	126.3198	127.4783	128.6864	129.3002	128.7598	127.7872	127.2468
127.8534	130.403	135.8299
20-03-2003	126.7134	128.8205	130.503	130.91	129.5355	128.6986	128.9049
129.3515	129.7014	129.6646
24-03-2003	127.8683	128.9257	130.2388	130.6455	129.7943	129.6254	129.931
129.8741	128.9851	126.8371
25-03-2003	129.1	130.2476	130.9012	130.9531	130.6151	130.7049	130.7913
130.1774	128.3661	124.9209
26-03-2003	125.6242	126.9605	127.6759	127.9296	127.8159	127.4472	127.5628
127.9229	127.3789	125.0737
27-03-2003	124.7791	125.8135	126.5636	126.991	126.9025	126.192	126.0366
126.4924	126.641	125.8787
28-03-2003	122.3302	126.0583	127.9815	128.5992	128.3795	127.8916	128.3327
129.1298	128.5795	125.4272
31-03-2003	122.9495	125.0476	126.0806	126.3641	126.2762	126.1326	126.0025
126.059	126.5255	127.6066
01-04-2003	121.6614	124.0167	125.1119	125.3331	125.1521	124.9378	124.741
124.738	125.1534	126.19
02-04-2003	125.0237	123.559	123.4063	123.9853	124.6415	124.8972	124.7938
124.655	124.8553	125.7382
03-04-2003	126.3097	126.0699	125.733	125.4118	125.3025	125.3965	125.3452
125.2865	125.4503	125.9926
04-04-2003	125.7782	127.0048	127.1993	126.7665	126.2338	125.8187	125.2984
124.9427	125.0865	125.9987
07-04-2003	129.3579	128.426	127.4094	126.4248	125.6679	125.0329	124.2881
123.8381	124.0886	125.3858
08-04-2003	126.2659	124.0576	123.1628	122.9543	122.7591	122.1958	121.3761
120.9294	121.4654	123.5695
09-04-2003	126.3295	123.0105	122.019	122.1099	121.8008	120.9466	120.2971
119.9777	120.1519	121.0496
10-04-2003	124.3917	122.337	121.527	121.2929	120.9075	120.0693	119.0389
118.5341	119.225	121.7831
11-04-2003	123.9958	122.8901	122.4071	122.1863	121.8305	121.2028	120.3991
119.6126	119.0208	118.7904
14-04-2003	125.304	122.2488	120.9091	120.3245	119.4888	118.5318	117.8937
117.7785	118.4408	120.169
15-04-2003	124.8533	121.7238	120.7396	120.6309	120.1175	119.1021	118.1599
118.0649	119.5515	123.4267
16-04-2003	123.9053	122.5052	122.1846	121.9726	120.8658	119.9848	119.7841
119.4567	118.5273	116.6094
17-04-2003	123.8844	123.4679	122.8284	122.0502	121.219	120.6142	120.2503
119.8874	119.3611	118.5235
18-04-2003	123.6323	123.7948	122.0972	120.1219	119.2715	118.8316	118.4449
118.3768	118.6977	119.4523
21-04-2003	122.3508	121.7169	120.978	120.2084	119.4818	118.8801	118.5117
118.4959	118.9496	119.9958
22-04-2003	117.9191	119.016	118.9652	118.2582	117.4338	117.0787	116.921
116.3783	115.034	112.5141
23-04-2003	118.5	119.7072	119.6464	118.9248	118.1209	117.6129	117.2297
116.6479	115.6375	113.9854
24-04-2003	118.0479	118.582	117.8957	116.5096	115.0604	114.1895	113.3827
112.5227	112.3112	113.2537
25-04-2003	115.3071	118.5252	118.3827	116.2328	113.9355	113.212	111.8608
109.7278	109.4651	112.9879
28-04-2003	122.1383	116.8937	113.6989	111.7677	110.2333	108.4609	107.1537
106.8094	107.67	110.121
30-04-2003	119.0417	117.4247	115.4031	113.3166	111.4878	110.2125	109.6868
109.5567	109.2572	108.3298
01-05-2003	121.1255	119.4505	117.2919	114.9878	112.8511	111.1767	110.2052
109.7325	109.4179	109.0029
02-05-2003	123.9351	118.9644	114.7846	111.4688	109.2048	107.9599	107.1667
106.7754	106.8961	107.5548
06-05-2003	116.866	113.4291	109.653	106.2401	103.9816	103.0981	103.0826
103.5084	103.96	104.0048
07-05-2003	116.0361	111.157	107.3176	104.5393	102.9419	102.3901	102.433
102.6595	102.6603	102.023
08-05-2003	116.0654	112.1026	108.9119	106.6342	105.4982	105.428	105.9504
106.4038	106.1187	104.4613
09-05-2003	113.4319	113.3651	111.3783	108.8158	107.293	106.8521	106.5365
106.5337	106.9903	107.9479
12-05-2003	116.0398	115.5277	112.5694	109.1824	107.6339	107.2938	106.8246
106.7944	107.5312	109.2402
13-05-2003	120.072	119.0612	115.5547	111.7628	110.0286	109.734	109.5997
109.7888	110.2447	110.8126
14-05-2003	123.7596	121.8108	117.7045	113.6668	111.9524	111.785	111.6971
111.2282	109.7502	106.6283
15-05-2003	126.519	125.5295	120.6593	115.0791	111.7319	110.4199	109.9832
109.5777	108.3265	105.3911
16-05-2003	123.7121	123.7787	118.2689	111.8345	108.6122	107.7476	107.5982
107.446	106.3817	103.5025
19-05-2003	129.5423	126.7081	120.6022	114.6696	111.5721	110.6218	110.6399
110.6262	109.5502	106.4368
20-05-2003	131.5287	128.358	123.7836	119.3856	116.4432	115.1857	114.7981
114.0028	111.7437	107.1061
21-05-2003	132.9794	129.0908	125.4157	122.1759	119.6083	118.0631	116.8621
114.8441	111.1378	105.0621
22-05-2003	134.482	129.4246	125.2607	121.9485	119.3591	116.9676	114.6423
112.4364	110.3236	108.2737
23-05-2003	137.8192	132.5841	127.8065	124.0915	121.5589	118.9617	116.3412
114.215	112.8307	112.4191
26-05-2003	150	136.3944	129.6574	126.0651	123.1792	120.1585	117.5713
116.1498	116.443	119.0616
27-05-2003	140.6262	134.6105	130.005	126.2856	122.7857	119.0079	116.2345
114.9039	114.5984	115.1993
28-05-2003	133.0564	129.166	125.7507	122.5701	119.1193	115.1612	112.5972
111.7337	111.7082	112.0993
29-05-2003	133.3556	131.6351	128.6401	124.931	120.8293	116.8296	114.6457
114.0274	113.6584	112.6745
30-05-2003	136.614	135.7701	132.8454	128.7274	124.0985	119.772	117.3432
116.6145	116.6199	116.775


As Jeff explained I used the same code given at
http://www.quantmod.com/examples/chartSeries3d/
However what I got some funny figure. Can you please guide me how to get
such surface plot here? Is there any direct package? I also used
"tframePlus" package however got error that :

Error : object 'tfSet' not found whilst loading namespace 'tframePlus'
Error: package/namespace load failed for 'tframePlus'


Any solution please? http://www.nabble.com/file/p25426141/dat.xls dat.xls 



Jeff Ryan wrote:
> 
> Shane beat me to it w.r.t the link...
> 
> That aside, I posted this a while back as an example for doing what
> you want.  quantmod will be getting this natively at some point, but
> for now the code can serve as an example:
> 
> http://www.quantmod.com/examples/chartSeries3d/
> 
> HTH
> Jeff
> 
> On Tue, Jun 2, 2009 at 12:31 PM, Shane Conway <shane.conway at gmail.com>
> wrote:
>> It's actually tframePlus:
>> http://cran.r-project.org/web/packages/tframePlus/.
>>
>> On Tue, Jun 2, 2009 at 1:25 PM, megh <megh700004 at yahoo.com> wrote:
>>>
>>> It is saying that, this package is not available :
>>>
>>>> install.packages("tramePlus")
>>> Warning in install.packages("tramePlus") :
>>>  argument 'lib' is missing: using
>>> 'C:\Users\Arrun's\Documents/R/win-library/2.9'
>>> --- Please select a CRAN mirror for use in this session ---
>>> Warning message:
>>> In getDependencies(pkgs, dependencies, available, lib) :
>>>  package ‘tramePlus’ is not available
>>>
>>> Any better idea please?
>>>
>>>
>>>
>>>
>>> megh wrote:
>>>>
>>>> Hi, I have following multivariate time series :
>>>> start = as.Date("01/01/05", format="%m/%d/%y")
>>>> end = as.Date("12/31/05", format="%m/%d/%y")
>>>> dates = seq(start, end, by=1)
>>>>
>>>> dat = matrix(rnorm(length(dates)*4), length(dates))
>>>> dat1 = t(apply(dat, 1, function(x) x+t(c(100, 110, 120, 130))))
>>>>
>>>> library(zoo)
>>>> dat2 = zoo(dat1, dates); head(dat2)
>>>>
>>>> Now I want to get "surface plot" wherein x-axis is time, y-axis
>>>> represents
>>>> 1,2,3,4, and z-axis is for values of "dat2". Is there any R drawing
>>>> device
>>>> to do that?
>>>>
>>>> Regards,
>>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/Surface-plot-of-multivariate-time-series-tp23827284p23836769.html
>>> Sent from the Rmetrics mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> R-SIG-Finance at stat.math.ethz.ch mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>>> -- Subscriber-posting only.
>>> -- If you want to post, subscribe first.
>>
>> _______________________________________________
>> R-SIG-Finance at stat.math.ethz.ch mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
>> -- Subscriber-posting only.
>> -- If you want to post, subscribe first.
>>
> 
> 
> 
> -- 
> Jeffrey Ryan
> jeffrey.ryan at insightalgo.com
> 
> ia: insight algorithmics
> www.insightalgo.com
> 
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
> 
> 

-- 
View this message in context: http://www.nabble.com/Surface-plot-of-multivariate-time-series-tp23827284p25426141.html
Sent from the Rmetrics mailing list archive at Nabble.com.



More information about the R-SIG-Finance mailing list