Search found 25 matches

by John_Val
Sat Mar 12, 2011 3:58 pm
Forum: ARCH and GARCH Models
Topic: ARMA-ANN-GARCH model
Replies: 3
Views: 8809

Re: ARMA-ANN-GARCH model

Thanks on the above problem. Using the same model, I wrote a program to loop over 20 different innial values, while saving the u,h series, the parameters and functional value. When I introduce the loop I get a new error message in the function, which I donnot know what it means. I pasted the full pr...
by John_Val
Fri Mar 11, 2011 5:24 pm
Forum: ARCH and GARCH Models
Topic: ARMA-ANN-GARCH model
Replies: 3
Views: 8809

ARMA-ANN-GARCH model

hi, I am trying to estimate an ARMA-ANN-ARCH model. The ANN component of the model is defined within a function. When I write the function I get an error message that RATS expects a integer not real, which I donnot know how to get around. Can you also look at the program to see if I wrote everything...
by John_Val
Wed Feb 09, 2011 11:59 am
Forum: Help With Programming
Topic: Creating shading series
Replies: 3
Views: 6900

Re: General Question

hi, I placed ***** to show where I think the the problem is. In the program I don't have any *****. For example, in the below program I want comput1 to occur if the first two if statements are true, while compute2 occurs if the first and third if statements are true. Did I set up the code correctly....
by John_Val
Tue Feb 08, 2011 5:03 pm
Forum: Help With Programming
Topic: Creating shading series
Replies: 3
Views: 6900

Creating shading series

I have 2 series hist and RSI from time 10 to 257. I want to create a dummy variable shade that is equal to 1 if hist(t)<0 and hist(t-1)>0 and RSI(t)>=60 It is also equal to 1 if hist(t)<0 and hist(t-1)>0 and RSI(t-1) >=60. When I run the program nothing gets recorded. I presume I did not set up corr...
by John_Val
Fri Feb 04, 2011 8:11 pm
Forum: Other RATS Usage Questions
Topic: Redimensioning a vector
Replies: 1
Views: 7626

Redimensioning a vector

Hi,

I want to redimension a vector continously within a do loop.
As a simple example, I wrote

dec vec hhh

do i=1,5
dimension hhh(i)
com hhh(i)=i
end do

dis hhh
NA NA NA NA 5.00000

How can I redimension while keeping all the previous values?
by John_Val
Wed Jun 02, 2010 3:20 pm
Forum: Help With Programming
Topic: Defining a function
Replies: 5
Views: 8368

Re: Defining a function

I am now trying to do a little simulation using this function, but it is not evaluating within a do loop. Any calculations outside the loop work fine. com draws=100 dec vec stock(draws+1) call(draws+1) com dt=1.0/365 com stock(1)=20 com X=20 com mu=0.01 com sigma=0.9 com r=0.03 do i=1,draws com stoc...
by John_Val
Wed Jun 02, 2010 1:24 pm
Forum: Help With Programming
Topic: Defining a function
Replies: 5
Views: 8368

Re: Defining a function

If I understand correctly,

exp(K*log(lambda)-%lngamma(K+1)) = (exp(-lambda)*lambda^k)/%factorial(k)

I tryed a few calculations for values of lambda and K, but they don't equal.
by John_Val
Tue Jun 01, 2010 4:13 pm
Forum: Help With Programming
Topic: Defining a function
Replies: 5
Views: 8368

Defining a function

hello, I set up the following function, but when I try to print a value it comes up as NA function JumpM n lambda k F X sigma delta gamma T r type integer n X type real JumpM lambda K F sigma delta gamma T r local real bn d1n d2n com JumpM=0 do i=0,n com bn = -lambda*K + i*gamma/T com d1n = ( log(F/...
by John_Val
Wed May 12, 2010 5:03 pm
Forum: Other RATS Usage Questions
Topic: Find Instruction
Replies: 5
Views: 12321

Re: Find Instruction

I am randomizing over inital values, for example over 50 draws. When I use bfgs the program breaks down most of the time if the max iter is to high. When bfgs does work it always gives negative function values, even though this is a least squares estimation. When I use simplex or genetic the estimat...
by John_Val
Mon May 10, 2010 12:59 pm
Forum: Other RATS Usage Questions
Topic: Find Instruction
Replies: 5
Views: 12321

Re: Find Instruction

I am going to try with just one maturity , 20 prices, using find. I wrote the code below, but the program breaks down and I get a not responding message. Callerr is the sum of squared errors for Call prices and Puterr is the same but for put prices. If you could look to see where I am going wrong. a...
by John_Val
Sun May 09, 2010 8:27 pm
Forum: Other RATS Usage Questions
Topic: Find Instruction
Replies: 5
Views: 12321

Find Instruction

I want to fit an option pricing model to set of prices via NLLS, for the date May 07. For May 07 I have 10 call prices and 10 put prices for 4 different maturities. So, there are a total of 80 prices. For the estimation I have to set up the full sum of squared errors, not just supply the variables a...
by John_Val
Fri Apr 30, 2010 10:25 am
Forum: ARCH and GARCH Models
Topic: MGARCH estimation
Replies: 7
Views: 11698

Re: MGARCH estimation

I am using the general command, garch(p=1,q=1,method=bhhh,mvhseries=HH,iters=500,pmethod=simplex,piters=20,subiter=100,regressors) / dssec dsp For the two mean equations I am going to leave them as depending only on a constant, but I want the variance and covariance equations to include the regresso...
by John_Val
Sun Apr 18, 2010 3:43 pm
Forum: ARCH and GARCH Models
Topic: MGARCH estimation
Replies: 7
Views: 11698

Re: MGARCH estimation

I'm still getting the same error message. I made the correction from above and I changed the parameter values to com a12 = .9 ; com a21=0.7 ; com b12=.9 ;com b21=0.7 ; com c12=.8 ; com c21 = 0.7, but nothing changed, covm is still not invertible. ## MAT14. Non-invertible Matrix. Using Generalized In...
by John_Val
Sun Apr 18, 2010 12:00 pm
Forum: ARCH and GARCH Models
Topic: MGARCH estimation
Replies: 7
Views: 11698

Re: MGARCH estimation

Hello,
I squared the lagged residuals, but I am still getting the same error message, that covm is not invertible. This is coming up for almost every data point.

I know I can just use the GARCH command, but I am trying to become more familiar and better with rats' coding.
by John_Val
Sun Apr 18, 2010 8:42 am
Forum: ARCH and GARCH Models
Topic: MGARCH estimation
Replies: 7
Views: 11698

MGARCH estimation

I am trying to estimate a MGARCH(1,1) model but the variance-covariance matrix is coming up as non invertible. How can I correct this? lin(noprint) baa / resids1 # constant com AO = %beta(1) com a11 = %seesq lin(noprint) tbill3 / resids2 # constant com BO = %beta(1) com b11 = %seesq com c11 = (a11*b...