[R-SIG-Finance] [R-sig-finance] A VaR question
RON70
ron_michael70 at yahoo.com
Fri Nov 27 07:45:23 CET 2009
I want to make another point here. My question is can I take "co" matrix as
DGP for a VAR? Here I calculated the roots for the ch. equation :
A2 = A1 = co
library(PolynomF)
z = polynom()
p11 <- 1 - A1[1,1]*z - A2[1,1]*z^2
p12 <- 0 - A1[1,2]*z - A2[1,2]*z^2
p13 <- 0 - A1[1,3]*z - A2[1,3]*z^2
p21 <- 0 - A1[2,1]*z - A2[2,1]*z^2
p22 <- 1 - A1[2,2]*z - A2[2,2]*z^2
p23 <- 0 - A1[2,3]*z - A2[2,3]*z^2
p31 <- 0 - A1[3,1]*z - A2[3,1]*z^2
p32 <- 0 - A1[3,2]*z - A2[3,2]*z^2
p33 <- 1 - A1[3,3]*z - A2[3,3]*z^2
p <- p11*(p22*p33 - p23*p32) - p12*(p21*p33 - p23*p31) + p13*(p21*p32 -
p22*p31)
> abs(solve(p))
[1] 1.6920982 1.5520308 1.4688865 0.4688865 0.5520308 0.6920982
You see there is no unit root, which is one of the fandamental properties
for a co-integrated VAR DGP.
Best,
RON70 wrote:
>
> Thanks Matifou for your reply. Yes I want to simulate VAR with those
> parameters. However here my problem is those parameters are estimated
> parameters not actual one. Therefore I dont think I can apply TVAR.simin()
> directly on those parameters. You see, ch equation for those estimated
> parameters doesnt give one unit root, which is the fundamental property
> for a co-integrated VAR DGP.
>
> Therefore I want to do some some tweaks so that I can get a revised
> parameter set from those estimated parameters such that ch. equation
> (based on revised parameters) gives exactly one unit root. Then I can use
> TVAR.simin() to generate data.
>
> Therefore my question is : How can I tweak those estimated parameters?
>
> Best,
>
>
>
> matifou wrote:
>>
>> Hi RON70
>>
>> Not sure about what you want to do... So you want to simulate a VAR with
>> those parameters? There is the function TVAR.simin package tsDyn that
>> allow you to simulate a VAR, see:
>>
>> co<-matrix(c(0.985, 0.283, -1.714, 0.125, 1.100, -1.491,0.071,
>> -0.089, 1.388), ncol=3, byrow=TRUE)
>> library(tsDyn)
>>
>> TVAR.sim(B=cbind(co,co),nthresh=0, inc="none", lag=2)
>>
>> Hope this is what you wanted?
>>
>> MAT2009
>>
>> RON70 a écrit :
>>> I think I should be more clear on what I would like to do. From that
>>> estimated model I would like to get a "Real" VAR DGP, perhaps by
>>> tweaking
>>> some of the coeficients. Which I would use to simulate artrificial data,
>>> for
>>> some study. If somebody shows me some lihgt on how I can achive that, I
>>> would be truly grateful.
>>>
>>> Best,
>>>
>>>
>>>
>>> RON70 wrote:
>>>
>>>> Hi all,
>>>>
>>>> My problem seems to be bizzare, however I want to do like that. Here I
>>>> have estimated a VECM model from my dataset (seems not stationary) and
>>>> once I converted those into a VAR representation I have following
>>>> estimates :
>>>>
>>>>
>>>>> A1; A2; A3; A4
>>>>>
>>>> V1 V2 V3
>>>> 1 0.985 0.283 -1.714
>>>> 2 0.125 1.100 -1.491
>>>> 3 0.071 -0.089 1.388
>>>> V1 V2 V3
>>>> 1 0.258 -0.493 1.459
>>>> 2 0.252 -0.387 1.165
>>>> 3 -0.057 0.076 -0.536
>>>> V1 V2 V3
>>>> 1 0.332 -0.459 0.251
>>>> 2 0.482 -0.686 0.313
>>>> 3 0.112 -0.104 0.218
>>>> V1 V2 V3
>>>> 1 -0.532 0.624 -0.006
>>>> 2 -0.619 0.714 -0.044
>>>> 3 -0.129 0.121 -0.069
>>>>
>>>> Now I took them as an original DGP process and checked the solution of
>>>> it's ch. equation. I got following :
>>>>
>>>>
>>>>> library(PolynomF)
>>>>> z = polynom()
>>>>>
>>>>>
>>>>> p11 <- 1 - A1[1,1]*z - A2[1,1]*z^2 - A3[1,1]*z^3 - A4[1,1]*z^4
>>>>> p12 <- 0 - A1[1,2]*z - A2[1,2]*z^2 - A3[1,2]*z^3 - A4[1,2]*z^4
>>>>> p13 <- 0 - A1[1,3]*z - A2[1,3]*z^2 - A3[1,3]*z^3 - A4[1,3]*z^4
>>>>>
>>>>>
>>>>> p21 <- 0 - A1[2,1]*z - A2[2,1]*z^2 - A3[2,1]*z^3 - A4[2,1]*z^4
>>>>> p22 <- 1 - A1[2,2]*z - A2[2,2]*z^2 - A3[2,2]*z^3 - A4[2,2]*z^4
>>>>> p23 <- 0 - A1[2,3]*z - A2[2,3]*z^2 - A3[2,3]*z^3 - A4[2,3]*z^4
>>>>>
>>>>> p31 <- 0 - A1[3,1]*z - A2[3,1]*z^2 - A3[3,1]*z^3 - A4[3,1]*z^4
>>>>> p32 <- 0 - A1[3,2]*z - A2[3,2]*z^2 - A3[3,2]*z^3 - A4[3,2]*z^4
>>>>> p33 <- 1 - A1[3,3]*z - A2[3,3]*z^2 - A3[3,3]*z^3 - A4[3,3]*z^4
>>>>>
>>>>> p <- p11*(p22*p33 - p23*p32) - p12*(p21*p33 - p23*p31) + p13*(p21*p32
>>>>> -
>>>>> p22*p31)
>>>>>
>>>>>
>>>>> abs(solve(p))
>>>>>
>>>> [1] 1.521516 2.102119 2.102119 4.912478 4.912478 1.000233 1.000233
>>>> 1.502034 1.502034 1.228100 2.536582 5.342635
>>>>
>>>> Now if I assume (upto a few significant digits) "1.000233 1.000233 "
>>>> both
>>>> equal to "1" then, I am actually getting two unit roots here. Therefore
>>>> I
>>>> am wondering how to tackle it as VAR is defined on max one unit root
>>>> process.
>>>>
>>>> Am I missing anything? Can anyone please help me?
>>>>
>>>> Best
>>>>
>>>>
>>>
>>>
>>
>> _______________________________________________
>> 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://old.nabble.com/A-VaR-question-tp26508077p26535989.html
Sent from the Rmetrics mailing list archive at Nabble.com.
More information about the R-SIG-Finance
mailing list