# 15.2. Characteristic value¶

At the top of the Data window is the control for
setting the *characteristic value*, or *CV*, of a data group. In this
section, the purpose and use of the CV is explained.

The CV is a user-defined number which is associated with the data set and is used for special purposes when evaluating the math expressions associated with def and path parameters. By default, ARTEMIS simply increments the CV value for each data set imported – the first is set to 1, the second to 2, and so on. These values can be changed, but should always be integer-valued.

The CV value is used in two ways to construct rich math expressions and expressive fitting models.

## 15.2.1. The CV token¶

Consider a multiple data set fit to a material measured at various temperatures. For this discussion, let's consider a rock salt structured metal oxide, for instance ZnO. Let's also suppose that we have measured data at three temperatures, 10 K, 300 K, and 500 K.

In a multiple data set fit, you may choose to model the σ^{2} of the first shell Zn-O bond using an Einstein model. This
allows you to parameterize the σ^{2} at each temperature
as a function of a single variable parameter, the Einstein
temperature. To do this, you must define a guess parameter to
represent the Einstein temperature like so:

```
guess thetae = 500
```

The functional form of the Einstein model takes the variable Einstein temperature and the sample's measurement temperature as its arguments.

- E. Sevillano, H. Meuth, and J. J. Rehr. Extended x-ray absorption fine structure Debye-Waller factors. I. Monatomic crystals.
*Phys. Rev. B*, 20:4908–4911, Dec 1979. doi:10.1103/PhysRevB.20.4908.

```
path {
sigma2 = eins(temp, thetae)
}
```

where `temp`

represents the sample temparature. The pseudo-syntax
used here is simply meant to represent the σ^{2} parameter
on a the Path page.

In a multiple data set fit, you would have to take care that `temp`

is
replaced each time it is used. That could be done in two ways. You could
use various set parameters:

```
set temp1 = 10
set temp2 = 300
set temp3 = 500
path for data set 1 {
sigma2 = eins(temp1, thetae)
}
path for data set 2 {
sigma2 = eins(temp2, thetae)
}
path for data set 3 {
sigma2 = eins(temp3, thetae)
}
```

Or you could simply state the temperature explicitly in the path parameter math expressions:

```
path for data set 1 {
sigma2 = eins(10, thetae)
}
path for data set 2 {
sigma2 = eins(300, thetae)
}
path for data set 3 {
sigma2 = eins(500, thetae)
}
```

Both of those solutions work. But neither make effective use of the model building automation in ARTEMIS. In the chapter on the Path window, you learned about various ways of pushing path parameter values onto other paths. One efficient way of setting up a multiple data set fit would be to edit the path parameters for one of the data sets, then push the path parameters onto the other data sets.

Using the two strategies summarized above, you would need to do considerable editing after pushing the path parameter values. That sort of editing is error-prone.

Here is a third way of solving this problem.

Set the CV for the three data sets to the temperature at which the data were measured. In our example, the three data sets would get CV values of 10, 300, and 500.

Next, edit the σ

^{2}path parameter for one of the data sets to readpath for data set 1 { sigma2 = eins([CV], thetae) }

Finally, push this σ

^{2}value on the other data sets without editing those to which it is pushed.

When ARTEMIS evaluates the fitting model, it will replace
the `[CV]`

token with the appropriate characteristic value. In
short, the computer handles the error-prone (for a human) task of
editing the many σ^{2} path parameters.

While this may seem like a small improvement over handling the editing chores yourself, use of the CV really pays off for large or complicated fitting models. For a multiple data set fit with many data sets, use of the CV saves quite a bit of editing. Furthermore, you can use the CV value in many path parameter math expressions. For example, suppose you were to model the ΔR values with a temperature-dependent, linear explansion coefficient. The use of the CV in those math expressions saves a lot of error-prone, manual editing!

## 15.2.2. Use in lguess parameters¶

The second use of the CV is along with lguess parameters. These parameters are an eficient way of generating per-data-set guess parameters in a multiple data set fit while still making good use of the automation in ARTEMIS for pushing path parameter math expressions between data sets.

Let's again consider the ZnO sample measured at the same three temparatures. This time, however, we choose to float an independent σ² parameter at each temperature.

The straightforward way of doing this would be something like

```
guess ss1 = 0.002
guess ss2 = 0.004
guess ss3 = 0.006
path for data set 1 {
sigma2 = ss1
}
path for data set 2 {
sigma2 = ss2
}
path for data set 3 {
sigma2 = ss3
}
```

Here is how this can be done using the CV and an lguess parameter. First, set the CV values to the temperature values, as before. Next, do the following:

```
lguess ss = 0.002
path for data set 1 {
sigma2 = ss
}
path for data set 2 {
sigma2 = ss
}
path for data set 3 {
sigma2 = ss
}
```

ARTEMIS will notice that `ss`

is an lguess
parameter. For each data set in which it is used, ARTEMIS
will create a guess parameters named `ss_[CV]`

, where, as before,
the `[CV]`

is replaced by the CV value.

In the case of our example, three guess parameters will be
created called `ss_10`

, `ss_300`

, and `ss_500`

. Each of those
will be given the initial value of the coresponding lguess
parameter (0.002 in this case). The lguess parameter will
not be used in the fit, but each of the generated guess
parameters will be floated. At the end of the fit, the log file will
report on each as for any other guess parameter.

The utility of the lguess parameter is that it allows you to define a common fitting model used across many data sets. You can use the automation built into ARTEMIS to push those path parameter math expressions between paths and data sets. Without further editing, the desired fitting model – with one guess parameter for each data set – is correctly made.

DEMETER is copyright © 2009-2016 Bruce Ravel – This document is copyright © 2016 Bruce Ravel

This document is licensed under The Creative Commons Attribution-ShareAlike License.

If DEMETER and this document are useful to you, please consider supporting The Creative Commons.