Generating Random Starting Values

For questions regarding programming in the EViews programming language.

Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt

elmst616
Posts: 32
Joined: Fri Apr 29, 2016 2:36 pm

Generating Random Starting Values

Postby elmst616 » Sun Mar 12, 2017 11:03 am

Hi I'm trying to randomly generate 16 starting values for a nonlinear MRSTAR.

I understand that starting values can be specified by the following:

Code: Select all

param c(1) scalar c(2) scalar c(3) scalar c(4) scalar c(5) scalar c(6) scalar c(7) scalar c(8) scalar c(9) scalar c(10) scalar c(11) scalar c(12) scalar c(13) c(14) scalar c(15) scalar c(16) scalar


But I'm trying to randomly generate starting values without having to redefine each scalar value, everytime I need to update or revise the starting values.

I thought I could do something like the this:

Code: Select all

param c(1) nrnd c(2) nrnd c(3) nrnd c(4) ... c(16) nrnd


But that doesn't seem to work. Any tips or suggestions would be appreciated.

EViews Matt
EViews Developer
Posts: 563
Joined: Thu Apr 25, 2013 7:48 pm

Re: Generating Random Starting Values

Postby EViews Matt » Mon Mar 13, 2017 9:04 am

You could fill the entire coefficient vector with random numbers:

Code: Select all

nrnd(c)


Return to “Programming”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 18 guests