![]() |
|
00001 /* Apophenia's documentation 00002 Copyright (c) 2005--2009 by Ben Klemens. Licensed under the modified GNU GPL v2; see COPYING and COPYING2. */ 00003 01651 /* I should do something with this: 01652 * 01653 * 01654 * 01655 * 01656 * This function can be used to temporarily modify the global options, 01657 to facilitate better encapsulation of code. Usage: 01658 01659 \code 01660 apop_opts_type tmp_opts; 01661 apop_opts_memcpy(&tmp_opts, &apop_opts, sizeof(apop_opts_type)); 01662 strcpy(apop_opts.output_name, "ad_hoc_temp_file"); 01663 [do things here] 01664 apop_opts_memcpy(&apop_opts, &tmp_opts, sizeof(apop_opts_type)); 01665 \endcode 01666 01667 If you just need a little more verbosity for a procedure, you probably 01668 don't need to use this function. Just try: 01669 \code 01670 apop_opts.verbose ++; 01671 [do things here] 01672 apop_opts.verbose --; 01673 \endcode 01674 01675 The philosophy is that the global variables are generally not going 01676 to change over the course of a program: either you are working on the 01677 screen, in the database, or piping out of STDOUT, and you likely won't 01678 change mid-stream. Thus, it is easier to set these globally at the top of 01679 the program but less convenient to switch frequently throughout the code. 01680 \ingroup global_vars 01681 */ 01682 01683 01721 /* To finish and add to the dataprep section: 01722 \paragraph Probit, logit, and other -obits 01723 The dependent variable for these models is a list of categories; this option is not relevant to continuous-valued dependent variables. 01724 01725 Your data source may include a list of numeric categories, in which case you can pick one of the above cases. 01726 01727 The main exception is when your data is a list of text factors, in which case your dependent variable isn't even a part of the data matrix. In this case, you can prep the data yourself, via a call to \c apop_text_to_factors, and then insert the column yourself (and pick a constant column or not as you prefer). Or, you can have the system do it for you, via a form like \code 01728 int textcol = 3; //where is the list of dependent categories 01729 apop_model *setmodel = apop_model_copy(apop_probit); 01730 Apop_settings_add_group(setmodel, apop_category, textcol); 01731 apop_estimate(yourdata, setmodel); 01732 \endcode 01733 01734 01735 You'll see that there are two questions here: should there be a constant column of ones, and where is the dependent column to be found? 01736 01737 Here are the rules for preparing the data set. 01738 01739 The first item is the 01740 01741 01742 There are two methods: 01743 01744 \li If the data set has no vector, 01745 01746 01747 for the -obit and -ogit models 01748 01749 If there is a vector in place, then I won't touch anything. 01750 01751 If there is no vector in place, then: 01752 --If you don't tell me where to find the dependent column, I'll go with column zero, and 01753 --move the data to the vector 01754 --replace the data there with ones, creating a constant column. 01755 --If you do tell me where to find the dependent column, via the settings, I'll turn that into a list of factors. 01756 01757 */