I am running following program from a book.
Can you kindly suggest me how to run and solve this problem?
------------------------------------------
workfile monte u100
!series=5
! draws=100
vector(!draws)montevec=0
--- I had an error message in this place/ !draws is not defined.
for !n=1 to !draws --- this also has some problem.
smpl 1 !series
series x=2+2*nrd
series y=x^2
montevec(!n)=@mean(x)/@mean(y)
next
series momentser=0
mtos(montevec, momentser)
----------------------------------------------
thank you very much!
Vector and MonteCarlo Simulation
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
Re: Vector and MonteCarlo Simulation
You appear to have a space between ! and draws in line 3. this makes !draws undefined.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Vector and MonteCarlo Simulation
Code: Select all
! draws=100
Code: Select all
!draws=100
Re: Vector and MonteCarlo Simulation
Thank you for your comment. But it doesn't work. !draws=100, but when I typed
vector(!draws)montvevec=0, it says still undefined. Can you correct me what I was wrong?
Thank you very much!
vector(!draws)montvevec=0, it says still undefined. Can you correct me what I was wrong?
Thank you very much!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Vector and MonteCarlo Simulation
Are you running in a program?
Re: Vector and MonteCarlo Simulation
I'm just running the program at the command space of Eviews.
Did you run my program and find no problem? Can you show your results/ Or, I might did a wrong way. I am not good at programming.
Did you run my program and find no problem? Can you show your results/ Or, I might did a wrong way. I am not good at programming.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Vector and MonteCarlo Simulation
You need to run as a program, not a series of commands.
Re: Vector and MonteCarlo Simulation
I will try and let you know. Thank you!
Re: Vector and MonteCarlo Simulation
It worked very good! Thank you very much! By the way, do I need to always run a program by using batch mode?
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 1 guest
