Optimizing the model with protocol 1

Test the MRF

First, test the MRF by clicking on its Error Value button.

Nothing happens--the number in the field next to the Error Value button is still 0.

We have to tell the MRF to use our Generator. Look at "iclamp soma" in the right hand panel of the MRF. See the little - (minus) sign? That means we haven't told the MRF to use the iclamp soma Generator.

To fix this, in the MRF click on
   Generators / Use Generator
and note the appearance of "Toggle" next to the Generators button.
Double click on "iclamp soma" in the right panel of the MRF, and the - changes to a + (plus).

Now when we click on the MRF's Error Value button, the iclamp soma Generator will run a simulation and contribute to the total error that appears in MRF's error value field.

Choose and use an optimization algorithm

In the MRF click on
   Parameters / Select Optimizer / Praxis

This brings up a MulRunFitter Optimize panel, which we'll call the "Optimize panel". Change the "# quad forms before return" (numeric field near the bottom of the Optimize panel) from 0 to 1.

Now click on the Optimize button in this panel.
When the MRF stops, note the error value, then click on Optimize again.
And again.

Does it seem to be stuck?
Watch the values in the parameters panel--do any of them occasionally go negative?

Try constraining the parameters

It would be meaningless for any of the actual biophysical parameters (Ra, cm, g_pas, A0, and A) to become negative. And a negative value for d (distance at which membrane conductance is halfway between A0 and A) would also make no sense.

So all of the parameters are positive definite. To apply this constraint, bring up the MRF's Domain panel by clicking on its
   Parameters / Domain Panel

In the MulRunFitter Domain panel click on
   group attributes / positive definite limits

Now do a few more optimization runs.
The error decreases very gradually, and NEURON's interpreter prints a lot of complaints about parameters trying to go negative.

What else can we try?

The PRAXIS optimizer often benefits from logarithmic scaling of parameters. This seems to be most helpful when two or more parameters are very different in size, i.e. when they differ by orders of magnitude. Which is the case in this problem.

To apply logarithmic scaling to all the parameters, in the MulRunFitter Domain panel click on
   group attributes / use log scale

Click on Optimize once more . . . much nicer!

Range constraints and log vs. linear scaling can also be set for individual parameters. Just double click on a parameter in the Domain panel, then change the contents of the edit field in the window that pops up--see the "DomainPanel" discussion in the Programmers' Reference entry about the MulRunFitter.

For an expanded discussion of parameter constraints, see D. Constraining parameters at http://www.neuron.yale.edu/neuron/static/docs/optimiz/func/params.html

More things to try

Add a Generator for protocol 2

Set up another Generator that uses the data obtained by injecting current into the dendrite. You can save yourself some effort by cloning the iclamp soma Generator, and then revising the clone.
  1. In the MRF, click on
       Generators / Clone
    then double click on "iclamp soma" in the MRF's right panel. The name of the new Generator will have a - sign in front of it.
  2. Change the name of the new Generator to "iclamp dend".
  3. Display the new Generator. Notice that it has controls for specifying the protocol constants, and radio buttons for viewing the graphs that show soma.v(0.5) and dendrite_1[9].v(0.5).
  4. Change the protocol constants so that they are appropriate for protocol 2.
  5. Get protocol 2's experimental data into this Generator. These are in files called nidend_vsoma.dat and nidend_vdend.dat. Use
       NEURON Main Menu / Vector / Retrieve from File
    to read the somatic membrane potential recording into NEURON's clipboard, then make sure the Generator's soma.v(0.5) button has been selected, and click on
       Regions / Data from Clipboard

    Follow similar steps to retrieve the dendritic membrane potential recording and paste it into the Generator.

Use the Generators

See if using the iclamp dend Generator by itself does a better job of optimizing this model. Be sure to
   Generators / Use Generator
and then "toggle" the Generators so you are using the iclamp dend Generator, and not the iclamp soma Generator. Also, for a fair test, before starting to optimize be sure to restore the parameters to their original values (Ra 100, cm 1, g_pas = A0 = 0.0001, A_ 0.0009, d_ 1000).

Finally, try using both Generators together and see if you get a better result, or at least faster convergence.

Hints:

  1. If you think the optimizer may have fallen into a local minimum, or is in a parameter region where the error surface is very shallow, try randomizing the parameters. In the MRF Optimize panel, click on
       Randomize with factor
    (a factor of 2 is generally sufficient) once or twice, then run another series of optimization simulations and see how soon the error falls below a predetermined level, and what the new parameter values are.
  2. You might find it interesting, and maybe even useful, to capture a record of parameter values and associated errors. To turn on "path logging", click on "Append the path to savepath.fit" in the MRF Optimize panel.


[ Outline | Previous ]


NEURON hands-on course
Copyright © 1998-2012 by N.T. Carnevale and M.L. Hines, all rights reserved.