design with a continuous attribute

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

design with a continuous attribute

Postby dsr » Wed Oct 30, 2013 1:59 am

I am having a first go at generating a design with a continuous attribute (price).
I have a problem - with my attempt always crashing ngene.

I start with an efficient design which seems to work ok.
Code: Select all
Design
;alts = alt1, alt2, alt3
;rows = 40
;block=4
;eff=(mnl,d)
;model:
U(alt1) = s[(n,0.4,0.2)] *saved[3,7,10,14] + r[(n,-0.05,0.02)]*risk[1,5,10,20]+ p[(n,-0.5,0.2)]*price[1,2.5,7.5,10]  /
U(alt2) = s*saved + r*risk + p*price $


I save this [initial.ngd] and then run:

Code: Select all
Design
;alts = alt1, alt2, alt3
;rows = 40
;block=4
;eff=(mnl,d)
;alg = neldermead(nointerim=0, stop=total(5000 iterations))
;start = initial.ngd
;model:
U(alt1) = s[(n,0.4,0.2)] *saved[3,7,10,14]  + r[(n,-0.05,0.02)]*risk[1,5,10,20]+ p[(n,-0.5,0.2)]*price[1:10:1] /
U(alt2) = s[(n,0.4,0.2)] *saved             + r[(n,-0.05,0.02)]*risk           + p              *price[1:10:1] $


This always crashes ngene (after c.250 iterations)

But if I remove the steps in the continuous price attribute:
Code: Select all
*price[1:10:1]


and use:
Code: Select all
*price[1:10]


then it works.

Any advice on where I am going wrong here?

thanks
Dan
dsr
 
Posts: 9
Joined: Wed May 27, 2009 7:22 pm

Re: design with a continuous attribute

Postby Michiel Bliemer » Wed Oct 30, 2013 11:01 am

The syntax price[1:10] indicates a continuous attribute between 1 and 10, so this syntax is correct in your case.
The syntax price[1:10:1] does NOT indicate a continuous attribute, but rather a discrete attribute. It is a shortcut for price[1,2,3,4,5,6,7,8,9,10], it will put in all attribute levels from 1 to 10 with a stepsize of 1.

Michiel
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm

Re: design with a continuous attribute

Postby dsr » Fri Nov 01, 2013 9:08 pm

Ah, yes, that would explain it!

I see now that the point about syntax of that form in Continuous Attributes section of the manual is only an aside.
This eliminates my next question about the difference between [1:10:1] and [1,2,3,4,5,6,7,8,9,10], since there is, of course, no difference.

many thanks
Dan
dsr
 
Posts: 9
Joined: Wed May 27, 2009 7:22 pm

Re: design with a continuous attribute

Postby Michiel Bliemer » Sat Nov 02, 2013 8:17 am

I sometimes use shortcuts like [1:10:0.1] to 'simulate' a continuous attribute without the need to use the NelderMead algorithm but rather use the ModifiedFederov algorithm instead. The shortcut is mainly there to save a lot of typing :-)
Michiel Bliemer
 
Posts: 1885
Joined: Tue Mar 31, 2009 4:13 pm


Return to Choice experiments - Ngene

Who is online

Users browsing this forum: No registered users and 16 guests

cron