Hi guys.
I want to make a matrix, but I have some problems. The code is as follows:
!imax = 5
matrix(!imax,!imax) amat = 0
for !i=1 to !imax
amat(!i,!i) = !i
next
!imax = 5
matrix(!imax,!imax) amat = 0
for !i=1 to !imax step = 2
amat(!i,!i) = !i
next
Soon the second line appears the error "!IMAX is not defined.", but I set in the previous line...
Thanks for the help!
question about matrix code
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: question about matrix code
Did you run it as a program.
As an aside, the syntax for step is:
As an aside, the syntax for step is:
Code: Select all
for !i=1 to !imax step 2
Re: question about matrix code
Thanks! I´m yet a noob programming in Eviews.Did you run it as a program.
As an aside, the syntax for step is:Code: Select all
for !i=1 to !imax step 2
I have other question. In this code:
!n = 6 workfile test u 1 !n
matrix(!n,2) x
x.fill 1.5, 0.7, 1, 2, 2.5, 3, 0.5, 2.2, 1.3, 1.7, 4, 3.5
vector(!n) y
y.fill 15, 17,18.2, 12.3, 13.4, 14
vector(3) beta
beta.fill 1, 0.5, 2
matrix u=@mnrnd(!n,1)
!mu_v = 4
!sigma_v = 2
matrix v=mu_v+sigma_v*@mnrnd(!n,1)
I have the error message:
SIGMA_V is not defined in "MATRIX V=MU_V+SIGMA_V*@MNRND(6,1)" Why? And now i ran as a program...
Thanks!
Re: question about matrix code
Well, missed the "!"...Thanks! I´m yet a noob programming in Eviews.Did you run it as a program.
As an aside, the syntax for step is:Code: Select all
for !i=1 to !imax step 2
I have other question. In this code:
!n = 6 workfile test u 1 !n
matrix(!n,2) x
x.fill 1.5, 0.7, 1, 2, 2.5, 3, 0.5, 2.2, 1.3, 1.7, 4, 3.5
vector(!n) y
y.fill 15, 17,18.2, 12.3, 13.4, 14
vector(3) beta
beta.fill 1, 0.5, 2
matrix u=@mnrnd(!n,1)
!mu_v = 4
!sigma_v = 2
matrix v=mu_v+sigma_v*@mnrnd(!n,1)
I have the error message:
SIGMA_V is not defined in "MATRIX V=MU_V+SIGMA_V*@MNRND(6,1)" Why? And now i ran as a program...
Thanks!
Another question, in the code of the first question:
!imax = 5
matrix(!imax,!imax) amat = 0
for !i=1 to !imax
amat(!i,!i) = !i
next
!imax = 5
matrix(!imax,!imax) amat = 0
for !i=1 to !imax step 2
amat(!i,!i) = !i
next
I have a syntax error in "AMAT(I!,I!)=1, why?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: question about matrix code
Nothing wrong that code that I can see - runs fine for me.
Who is online
Users browsing this forum: No registered users and 2 guests
