Federov algorithm

This forum is for posts that specifically focus on Ngene.

Moderators: Andrew Collins, Michiel Bliemer, johnr

Federov algorithm

Postby CMA » Fri Feb 25, 2022 1:04 pm

I have a question about the Federov algorithm.
When I run a program like the one below, I get the warnings "Defaulting to prior values of zero for the following priors" and "One or more attributes will not have level balance with the number of rows specified".

Code: Select all
Design
;alts = alt1*, alt2*
;rows = 380
;eff = (mnl,d)
;wtp = wtp1(b1,b2,b3,b4,b5,b6/b7)
;alg = mfederov(candidates = 30000,stop=total(10000 iterations))
;model:
U(alt1) = b1 * A[0,1,2,3,4] + b2 * B[0,1,2,3,4] + b3 * C[0,1,2,3,4] + b4 * D[0,1,2,3,4,5] +b5 * E[0,1,2,3,4] + b6 * F[0,1,2,3,4] + b7 * G[1,4,7,10]/
U(alt2) = b1 * A + b2 * B + b3 * C + b4 * D +b5 * E + b6 * F + b7 * G
$

The results are being output, but what is the problem?
If there is a problem, can you please tell me how to solve it?

Regards.
CMA
 
Posts: 34
Joined: Mon Jun 14, 2021 3:42 pm

Re: Federov algorithm

Postby Michiel Bliemer » Fri Feb 25, 2022 2:45 pm

Warnings are merely to tell you what Ngene is doing, namely you did not provide parameter priors so Ngene defaults them to zero. Further, 380 rows is not divisible by 6 levels for attribute D, so it is not possible to create a design with perfect attribute level balance (which is not a problem at all).

Looking at your attributes, some of them seem to categorical, e.g. 0,1,2,3,4, is that right? For categorical variables you will need to use dummy or effects coding. Attribute G seems the only one that is numerical (1,4,7,10). The modified Federov algorithm is a row-based algorithm and will generally not achieve a good level of attribute level balance for numerical attributes. For those attributes, you may want to specify specific ranges for how often each attribute should appear within the design. For example, with attribute G, you can say that each level needs to appear at least 80 times and at most 120 times across the 380 rows.

A design with 380 rows is extremely large, do you need so many rows? Also, a candidate set of 30,000 rows is huge, the algorithm will be extremely slow in evaluating each of these rows one by one and you would need to run the algorithm for many days. I would suggest using a candidate set of 5000 rows at most, and consider a much smaller number of rows in your design.

Code: Select all
Design
;alts = alt1*, alt2*
;rows = 380
;eff = (mnl,d)
;wtp = wtp1(b1,b2,b3,b4,b5,b6/b7)
;alg = mfederov(candidates = 5000)
;model:
U(alt1) = b1.dummy[0|0|0|0]   * A[0,1,2,3,4]
        + b2.dummy[0|0|0|0]   * B[0,1,2,3,4]
        + b3.dummy[0|0|0|0]   * C[0,1,2,3,4]
        + b4.dummy[0|0|0|0|0] * D[0,1,2,3,4,5]
        + b5.dummy[0|0|0|0]   * E[0,1,2,3,4]
        + b6.dummy[0|0|0|0]   * F[0,1,2,3,4]
        + b7                  * G[1,4,7,10](80-120,80-120,80-120,80-120)
        /
U(alt2) = b1 * A + b2 * B + b3 * C + b4 * D +b5 * E + b6 * F + b7 * G
$


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

Re: Federov algorithm

Postby CMA » Fri Feb 25, 2022 3:19 pm

Thanks for the quick answer.
All but attribute G are category variables. I didn't know that you can program that way with categorical and continuous variables. I will study it.
I need 380 lines for my research, so I will use your program.

Regards.
CMA
 
Posts: 34
Joined: Mon Jun 14, 2021 3:42 pm

Re: Federov algorithm

Postby Michiel Bliemer » Fri Feb 25, 2022 3:56 pm

When generating an efficient design, you always need to use the actual levels that you will use in model estimation. You will not use 0,1,2,3,4 because that is meaningless, categorical variables need to be converted to dummy coding first, which is what Ngene can automatically do via .dummy. With dummy coding, your model will estimate 4 parameters with a 5-level attribute. In total your model will have a lot of parameters.

Michiel
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 7 guests

cron