Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Option management with nested Which expressions' topicStudent Support Forum > General > "Option management with nested Which expressions"

Next Comment >Help | Reply To Topic
Author Comment/Response
Donald Griffin
09/06/07 07:55am

I am attempting to write a package that uses a large number of regression models to estimate parameters from a data set. I want the user to be able to call a single function, FitModel, with a number of options to indicate whether the fit should be linear or nonlinear, and what options should be estimated. To accomplish the option management for FitModel, I wrote a function that uses several nested Which expressions somewhat like a decision tree. The tips of the Which expressions then call a specific model function hidden in the package.

This works when FitModel is called with all default options, which trace the first test in each Which expression. However, any time a Which expression moves to the second test condition, the rest of the decision tree is returned unevaluated.

In theory, I think this should work, but I must be missing something very basic. I would greatly appreciate any suggestions as to how to fix this problem.

URL: ,

Subject (listing for 'Option management with nested Which expressions')
Author Date Posted
Option management with nested Which expressions Donald Griffin 09/06/07 07:55am
Re: Option management with nested Which express... yehuda ben-s... 09/06/07 1:36pm
Re: Option management with nested Which express... Donald Griffin 09/07/07 07:00am
Re: Option management with nested Which express... Donald Griffin 09/12/07 06:41am
Next Comment >Help | Reply To Topic