Module Expr Str ImportFrom alias Import alias identifier ImportFrom alias Import alias identifier Import alias identifier Import alias identifier ImportFrom alias ImportFrom alias Assign NameStore Num Assign NameStore ListLoad Str Str If CompareIn Str NameLoad body Assign TupleStore NameStore NameStore Call NameLoad NameLoad ListLoad Num Num ListLoad Num Num keyword Num Expr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr Num Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad Str NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Num Assign TupleStore NameStore NameStore Call NameLoad NameLoad ListLoad Num NameLoad ListLoad Num Num keyword Num keyword Num Expr Call NameLoad NameLoad NameLoad Expr Call NameLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad ListLoad Num NameLoad ListLoad ListLoad Num Num ListLoad Num Num keyword Num keyword Num Expr Call NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Str Expr Call NameLoad SubscriptLoad NameLoad Slice Num NameLoad SubscriptLoad NameLoad Slice Num NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad ListLoad Num NameLoad ListLoad ListLoad Num Num ListLoad Num Num keyword Num keyword Num Expr Call NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Str Expr Call NameLoad SubscriptLoad NameLoad Slice Num NameLoad SubscriptLoad NameLoad Slice Num NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad ListLoad Num NameLoad ListLoad ListLoad Num Num ListLoad Num Num ListLoad Num Num ListLoad Num Num keyword Num keyword Num Expr Call NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Str Expr Call NameLoad SubscriptLoad NameLoad Slice Num NameLoad SubscriptLoad NameLoad Slice Num NameLoad Str Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad ListLoad Num NameLoad ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num keyword Num keyword Num Expr Call NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Str Expr Call NameLoad SubscriptLoad NameLoad Slice Num NameLoad SubscriptLoad NameLoad Slice Num NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr Num Assign SubscriptStore NameLoad Index Num Num Assign TupleStore NameStore NameStore NameStore Call NameLoad Num ListLoad Num Num ListLoad ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num ListLoad Num Num Num keyword Num keyword Num keyword NameLoad Expr Call NameLoad SubscriptLoad NameLoad Slice Num SubscriptLoad NameLoad Slice Num Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Num Expr Call NameLoad Str NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr Num attr Num Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad Call AttributeLoad NameLoad attr TupleLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Num NameLoad Assign TupleStore NameStore NameStore Call NameLoad ListLoad Num Num Call AttributeLoad NameLoad attr ListLoad ListLoad Num Num Num ListLoad Num Num Num NameLoad Assign NameStore Num Assign NameStore Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore ListLoad Num Num Assign NameStore ListLoad ListLoad Num Num Num ListLoad Num Num Num Assign TupleStore NameStore NameStore NameStore Call NameLoad BinOpAdd NameLoad NameLoad NameLoad NameLoad keyword Num keyword Num Assign TupleStore NameStore NameStore NameStore TupleLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Expr Call NameLoad SubscriptLoad NameLoad Slice NameLoad SubscriptLoad NameLoad Slice NameLoad Str Assign NameStore Call NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr ListLoad Num Num Num Num keyword Num Expr Call NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str Assign NameStore Call NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Num Expr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr ListLoad Num Num Num Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Str keyword Num Expr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults UnaryOpUSub SubscriptLoad Call NameLoad NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Index Num ListLoad Num Num Num Expr Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad NameLoad Index Num If CompareIn Str NameLoad body ImportFrom alias Expr Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword BinOpSub NameLoad Call AttributeLoad NameLoad attr keyword NameLoad If CompareIn Str NameLoad body ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr keyword Num Expr Call NameLoad Str SubscriptLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num Slice Num Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad Num Num Num keyword Num Expr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call NameLoad Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr keyword ListLoad Num Num Num keyword Num keyword Str Expr Call NameLoad AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr keyword Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr ListLoad Num Num Num Num Assign NameStore Call AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr ListLoad Num Num Num Num keyword Num Expr Call NameLoad Str AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Lambda arguments args NameParam defaults UnaryOpUSub SubscriptLoad Call NameLoad NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Index Num ListLoad Num Num Num Expr Call NameLoad NameLoad Assign NameStore Call NameLoad NameLoad BinOpSub NameLoad Call AttributeLoad NameLoad attr Expr Call NameLoad SubscriptLoad NameLoad Index Num Expr Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword BinOpSub NameLoad Call AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad Expr Call NameLoad Call AttributeLoad NameLoad attr NameLoad Expr Str Expr Str Assign TupleStore NameStore NameStore NameStore Call NameLoad Num NameLoad NameLoad keyword Num keyword Num keyword Call AttributeLoad NameLoad attr Num If CompareIn Str NameLoad body Import alias identifier Import alias identifier Assign NameStore Call AttributeLoad NameLoad attr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Slice Num keyword Call AttributeLoad NameLoad attr SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Slice Num keyword Str Assign NameStore SubscriptLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Str Slice Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad
N/A N/A 
Created on Fri Feb 12 01:01:50 2010

Author: josef-pktd

latest result
-------------
all are very close
garch0 has different parameterization of constant
ordering of parameters is different


seed 2780185
h.shape (2000,)
Optimization terminated successfully.
         Current function value: 2093.813397
         Iterations: 387
         Function evaluations: 676
ggres.params [-0.6146253   0.1914537   0.01039355  0.78802188]
Optimization terminated successfully.
         Current function value: 2093.972953
         Iterations: 201
         Function evaluations: 372
ggres0.params [-0.61537527  0.19635128  4.00706058]
Warning: Desired error not necessarily achieveddue to precision loss
         Current function value: 2093.972953
         Iterations: 51
         Function evaluations: 551
         Gradient evaluations: 110
ggres0.params [-0.61537855  0.19635265  4.00694669]
Optimization terminated successfully.
         Current function value: 2093.751420
         Iterations: 103
         Function evaluations: 187
[ 0.78671519  0.19692222  0.61457171]
-2093.75141963

Final Estimate:
 LLH:  2093.750    norm LLH:  2.093750
    omega    alpha1     beta1
0.7867438 0.1970437 0.6145467

long run variance comparison
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
R
>>> 0.7867438/(1- 0.1970437- 0.6145467)
4.1757097302897526
Garch (gjr) asymetric, longrun var ?
>>> 1/(1-0.6146253 - 0.1914537 - 0.01039355) * 0.78802188
4.2937548579245242
>>> 1/(1-0.6146253 - 0.1914537 + 0.01039355) * 0.78802188
3.8569053452140345
Garch0
>>> (1-0.61537855 - 0.19635265) * 4.00694669
0.7543830449902722
>>> errgjr4.var() #for different random seed
4.0924199964716106

todo: add code and verify, check for longer lagpolys

 __future__ print_function N/A numpy np numpy.testing assert_almost_equal N/A matplotlib.pyplot plt N/A numdifftools ndt N/A statsmodels.api sm statsmodels.sandbox tsa statsmodels.sandbox.tsa.garch * N/A nobs 1000 N/A examples N/A garch rpyfit N/A N/A garch examples N/A N/A N/A err h N/A generate_kindofgarch nobs N/A 1.0 -0.95 N/A 1.0 0.1 mu 0.5 N/A N/A N/A plt figure N/A N/A N/A plt subplot 211 N/A N/A N/A plt plot err N/A N/A N/A plt subplot 212 N/A N/A N/A plt plot h N/A seed 3842774 N/A seed N/A N/A N/A np random randint 9999999 N/A N/A print seed seed N/A N/A N/A N/A np random seed seed N/A ar1 -0.9 N/A N/A err h N/A generate_garch nobs N/A 1.0 ar1 N/A 1.0 0.5 mu 0.0 scale 0.1 N/A N/A garchplot err h N/A N/A garchplot N/A err N/A -400 N/A h N/A -400 N/A N/A N/A N/A np random seed seed N/A N/A errgjr hgjr etax N/A generate_gjrgarch nobs N/A 1.0 ar1 N/A N/A 1 0 N/A 0.5 0 mu 0.0 scale 0.1 N/A N/A garchplot N/A errgjr N/A nobs N/A hgjr N/A nobs GJR-GARCH(1,1) Simulation - symmetric N/A N/A garchplot N/A errgjr N/A -400 nobs N/A hgjr N/A -400 nobs GJR-GARCH(1,1) Simulation - symmetric N/A N/A N/A N/A np random seed seed N/A N/A errgjr2 hgjr2 etax N/A generate_gjrgarch nobs N/A 1.0 ar1 N/A N/A 1 0 N/A 0.1 0.9 mu 0.0 scale 0.1 N/A N/A garchplot N/A errgjr2 N/A nobs N/A hgjr2 N/A nobs GJR-GARCH(1,1) Simulation N/A N/A garchplot N/A errgjr2 N/A -400 nobs N/A hgjr2 N/A -400 nobs GJR-GARCH(1,1) Simulation N/A N/A N/A N/A np random seed seed N/A N/A errgjr3 hgjr3 etax3 N/A generate_gjrgarch nobs N/A 1.0 ar1 N/A N/A 1 0 N/A 0.1 0.9 N/A 0.1 0.9 N/A 0.1 0.9 mu 0.0 scale 0.1 N/A N/A garchplot N/A errgjr3 N/A nobs N/A hgjr3 N/A nobs GJR-GARCH(1,3) Simulation N/A N/A garchplot N/A errgjr3 N/A -400 nobs N/A hgjr3 N/A -400 nobs GJR-GARCH(1,3) Simulation N/A N/A N/A N/A np random seed seed N/A N/A errgjr4 hgjr4 etax4 N/A generate_gjrgarch nobs N/A 1.0 ar1 N/A N/A 1.0 1 0 N/A 0 0.1 0.9 N/A 0 0.1 0.9 N/A 0 0.1 0.9 mu 0.0 scale 0.1 N/A N/A garchplot N/A errgjr4 N/A nobs N/A hgjr4 N/A nobs GJR-GARCH(1,3) Simulation N/A N/A garchplot N/A errgjr4 N/A -400 nobs N/A hgjr4 N/A -400 nobs GJR-GARCH(1,3) Simulation N/A varinno N/A N/A np zeros 100 N/A N/A varinno N/A 0 1.0 N/A N/A errgjr5 hgjr5 etax5 N/A generate_gjrgarch 100 N/A 1.0 -0.0 N/A N/A 1.0 1 0 N/A 0 0.1 0.8 N/A 0 0.05 0.7 N/A 0 0.01 0.6 mu 0.0 scale 0.1 varinnovation varinno N/A N/A garchplot N/A errgjr5 N/A 20 N/A hgjr5 N/A 20 GJR-GARCH(1,3) Simulation N/A seed N/A N/A N/A np random randint 9999999 N/A N/A print seed seed N/A x N/A N/A N/A N/A np arange 20 reshape 10 2 N/A x3 N/A N/A np column_stack N/A N/A N/A np ones N/A N/A N/A x shape N/A 0 1 x N/A N/A y inp N/A miso_lfilter N/A 1.0 0 N/A N/A np array N/A N/A -2.0 3 1 N/A 0.0 0.0 0 x3 N/A nobs 1000 N/A warmup 1000 N/A N/A N/A N/A np random seed seed N/A ar N/A 1.0 -0.7 N/A ma N/A N/A 1.0 0 0 N/A 0 0.8 0.0 N/A N/A errgjr4 hgjr4 etax4 N/A generate_gjrgarch N/A warmup nobs ar ma mu 0.4 scale 1.01 N/A N/A errgjr4 hgjr4 etax4 N/A N/A errgjr4 N/A warmup N/A hgjr4 N/A warmup N/A etax4 N/A warmup N/A N/A garchplot N/A errgjr4 N/A nobs N/A hgjr4 N/A nobs GJR-GARCH(1,3) Simulation - DGP N/A ggmod N/A Garch N/A errgjr4 N/A N/A errgjr4 mean N/A N/A ggmod nar 1 N/A N/A ggmod nma 1 N/A N/A ggmod _start_params N/A N/A np array N/A -0.6 0.1 0.2 0.0 N/A ggres N/A N/A ggmod fit start_params N/A N/A np array N/A -0.6 0.1 0.2 0.0 maxiter 1000 N/A N/A print ggres.params N/A ggres params N/A N/A garchplot N/A ggmod errorsest N/A ggmod h title Garch estimated N/A ggmod0 N/A Garch0 N/A errgjr4 N/A N/A errgjr4 mean N/A N/A ggmod0 nar 1 N/A N/A ggmod nma 1 N/A start_params N/A N/A np array N/A -0.6 0.2 0.1 N/A N/A ggmod0 _start_params start_params N/A ggres0 N/A N/A ggmod0 fit start_params start_params maxiter 2000 N/A N/A print ggres0.params N/A ggres0 params N/A ggmod0 N/A Garch0 N/A errgjr4 N/A N/A errgjr4 mean N/A N/A ggmod0 nar 1 N/A N/A ggmod nma 1 N/A start_params N/A N/A np array N/A -0.6 0.2 0.1 N/A N/A ggmod0 _start_params start_params N/A ggres0 N/A N/A ggmod0 fit start_params start_params method bfgs maxiter 2000 N/A N/A print ggres0.params N/A ggres0 params N/A g11res N/A N/A optimize fmin N/A N/A N/A params N/A N/A N/A N/A loglike_GARCH11 params N/A errgjr4 N/A N/A errgjr4 mean N/A 0 N/A 0.93 0.9 0.2 N/A N/A print g11res N/A llf N/A loglike_GARCH11 g11res N/A errgjr4 N/A N/A errgjr4 mean N/A N/A print N/A llf N/A 0 N/A N/A rpyfit examples N/A rpy r N/A N/A N/A r library fGarch N/A f N/A N/A r formula ~garch(1, 1) N/A fit N/A N/A r garchFit f data N/A errgjr4 N/A N/A errgjr4 mean include_mean False N/A N/A rpysim examples N/A rpy r N/A f N/A N/A r formula ~garch(1, 1) N/A x N/A N/A r garchSim n 500 N/A N/A print R acf N/A N/A N/A tsa acf N/A N/A np power x 2 N/A 15 N/A arma3 N/A Arma N/A N/A np power x 2 N/A arma3res N/A N/A arma3 fit start_params N/A -0.2 0.1 0.5 maxiter 5000 N/A N/A print N/A arma3res params N/A arma3b N/A Arma N/A N/A np power x 2 N/A arma3bres N/A N/A arma3b fit start_params N/A -0.2 0.1 0.5 maxiter 5000 method bfgs N/A N/A print N/A arma3bres params N/A xr N/A N/A r garchSim n 100 N/A x N/A N/A np asarray xr N/A ggmod N/A Garch N/A x N/A N/A x mean N/A N/A ggmod nar 1 N/A N/A ggmod nma 1 N/A N/A ggmod _start_params N/A N/A np array N/A -0.6 0.1 0.2 0.0 N/A ggres N/A N/A ggmod fit start_params N/A N/A np array N/A -0.6 0.1 0.2 0.0 maxiter 1000 N/A N/A print ggres.params N/A ggres params N/A g11res N/A N/A optimize fmin N/A N/A N/A params N/A N/A N/A N/A loglike_GARCH11 params N/A x N/A N/A x mean N/A 0 N/A 0.6 0.6 0.2 N/A N/A print g11res N/A llf N/A loglike_GARCH11 g11res N/A x N/A N/A x mean N/A N/A print N/A llf N/A 0 N/A N/A garchplot N/A ggmod errorsest N/A ggmod h title Garch estimated N/A fit N/A N/A r garchFit f data N/A x N/A N/A x mean include_mean False trace False N/A N/A print N/A N/A r summary fit N/A based on R default simulation
model = list(omega = 1e-06, alpha = 0.1, beta = 0.8)
nobs = 1000
(with nobs=500, gjrgarch doesn't do well

>>> ggres = ggmod.fit(start_params=np.array([-0.6, 0.1, 0.2, 0.0]), maxiter=1000)
Optimization terminated successfully.
         Current function value: -448.861335
         Iterations: 385
         Function evaluations: 690
>>> print('ggres.params', ggres.params
ggres.params [ -7.75090330e-01   1.57714749e-01  -9.60223930e-02   8.76021411e-07]
rearranged
8.76021411e-07 1.57714749e-01(-9.60223930e-02) 7.75090330e-01

>>> print(g11res
[  2.97459808e-06   7.83128600e-01   2.41110860e-01]
>>> llf = loglike_GARCH11(g11res, x-x.mean())
>>> print(llf[0]
442.603541936

Log Likelihood:
 -448.9376    normalized:  -4.489376
      omega       alpha1        beta1
1.01632e-06  1.02802e-01  7.57537e-01
 N/A  the following is for errgjr4-errgjr4.mean()
ggres.params [-0.54510407  0.22723132  0.06482633  0.82325803]
Final Estimate:
 LLH:  2065.56    norm LLH:  2.06556
        mu      omega     alpha1      beta1
0.07229732 0.83069480 0.26313883 0.53986167

ggres.params [-0.50779163  0.2236606   0.00700036  1.154832
Final Estimate:
 LLH:  2116.084    norm LLH:  2.116084
           mu         omega        alpha1         beta1
-4.759227e-17  1.145404e+00  2.288348e-01  5.085949e-01

run3
DGP
0.4/??    0.8      0.7
gjrgarch:
ggres.params [-0.45196579  0.2569641   0.02201904  1.11942636]
rearranged
const/omega  ma1/alpha1             ar1/beta1
1.11942636 0.2569641(+0.02201904) 0.45196579
g11:
[ 1.10262688  0.26680468  0.45724957]
-2055.73912687
R:
Final Estimate:
 LLH:  2055.738    norm LLH:  2.055738
           mu         omega        alpha1         beta1
-1.665226e-17  1.102396e+00  2.668712e-01  4.573224e-01
fit = r.garchFit(f, data = errgjr4-errgjr4.mean())
rpy.RPy_RException: Error in solve.default(fit$hessian) :
  Lapack routine dgesv: system is exactly singular

run4
DGP:
mu=0.4, scale=1.01
ma = [[1., 0, 0],[0, 0.8,0.0]], ar = [1.0, -0.7]
maybe something wrong with simulation

gjrgarch
ggres.params [-0.50554663  0.24449867 -0.00521004  1.00796791]
rearranged
1.00796791   0.24449867(-0.00521004)   0.50554663
garch11:
[ 1.01258264  0.24149155  0.50479994]
-2056.3877404
R include_constant=False
Final Estimate:
 LLH:  2056.397    norm LLH:  2.056397
    omega    alpha1     beta1
1.0123560 0.2409589 0.5049154
 N/A N/A erro ho etaxo N/A generate_gjrgarch 20 ar ma mu 0.04 scale 0.01 varinnovation N/A N/A np ones 20 N/A N/A sp500 examples N/A N/A tabular tb N/A scikits.timeseries ts N/A a N/A N/A tb loadSV C:\Josef\work-oth\gspc_table.csv N/A s N/A N/A ts time_series N/A N/A N/A a N/A 0 N/A Close N/A -1 dates N/A N/A ts date_array N/A N/A N/A a N/A 0 N/A Date N/A -1 freq D N/A sp500 N/A N/A N/A a N/A 0 N/A Close N/A -1 N/A sp500r N/A N/A np diff N/A N/A np log sp500