## Linear vs. Nonlinear Evalulation

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
hgm
Posts: 24657
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

### Re: Linear vs. Nonlinear Evalulation

I thought most strong programs have a very non-linear King-Safety term (the danger being assessed as a quadratic, or even quartic function of the enemy material attacking squares next to the King).

I would certainly count that as "non-linear evaluation". (I mean, if that would not count, what could possibly count?)

bob
Posts: 20916
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: Linear vs. Nonlinear Evalulation

Gerd Isenberg wrote:I have a question about the definition of linear versus nonlinear evaluation.
Is there any advantage to having a linear vs non-linear evaluation function? Would it make analyzing an evaluation function significantly easier if it was linear?
I don't particularly like the term. I prefer first-order, second-order, etc.

A first-order evaluation looks at specific features, one at a time, and sums the scores. A second-order evaluation looks at some specific features, as above, but then some features are combined as a product, such as pawn-shelter for the king and pieces attacking squares around the king. Obviously the weaker the pawns around the king, the more valuable it is to have your pieces around that king since there will be more attacking chances. So second-order uses two significant evaluation terms and combines them into one score, whether it be by simple multiplication, or by some sort of two-dimensional table look-up (I do this in Crafty) or whatever.

Gerd Isenberg
Posts: 2149
Joined: Wed Mar 08, 2006 7:47 pm
Location: Hattingen, Germany

### Re: Linear vs. Nonlinear Evalulation

bob wrote:
Gerd Isenberg wrote:I have a question about the definition of linear versus nonlinear evaluation.
Is there any advantage to having a linear vs non-linear evaluation function? Would it make analyzing an evaluation function significantly easier if it was linear?
I don't particularly like the term. I prefer first-order, second-order, etc.

A first-order evaluation looks at specific features, one at a time, and sums the scores. A second-order evaluation looks at some specific features, as above, but then some features are combined as a product, such as pawn-shelter for the king and pieces attacking squares around the king. Obviously the weaker the pawns around the king, the more valuable it is to have your pieces around that king since there will be more attacking chances. So second-order uses two significant evaluation terms and combines them into one score, whether it be by simple multiplication, or by some sort of two-dimensional table look-up (I do this in Crafty) or whatever.
I agree with that. Definition taken. Also have to think about Tord's elaboration a bit. Puhh, those math guys

bob
Posts: 20916
Joined: Mon Feb 27, 2006 6:30 pm
Location: Birmingham, AL

### Re: Linear vs. Nonlinear Evalulation

Gerd Isenberg wrote:
bob wrote: