home *** CD-ROM | disk | FTP | other *** search
- SHORT INSTRUCTIONS FOR PROGRAM PLOTFIT (VERSION 4.0)
- ====================================================
-
- This program was written in GFA Basic and will therefore require that
- you have the GFA Basic interpreter ( GFABASRO.PRG Versiom 2.0).
- This program may be used with a color or a mono Atari St computer.
- Once the program is started the appropriate file PLOTFIT.MON or
- PLOTFIT.COL will be read. After that these files will not be needed
- anymore. These file must reside in the same folder than the
- interpreter.
-
- This program is fully menu driven.
-
- PLOTFIT will allow you to graphically display the X, Y range pair
- with the optional error checking of the Y range. Different point
- symbols like lines may be used. There is no pie chart. The X- and
- Y- axis will automatically be adjusted for the chosen range.
- You may write to both axis and you may also add text at any place
- you like. Text may be chosen in different fonts. Logarithmic and
- linear representations of both axis are posssible. Many pictures
- can be drawn on the same screen. Lines and symbols may be combined.
- More than one data set may be created at the same time (<=8).
- All attributes from the data set (scale range, axis markings) will
- also be created and may be changed individually.
-
- Maximum number range: -2000000 -> 2000000
- Minimum number range: -0.01 -> 0.01
- Maximum number of points: 250, 500 for the last data set.
-
- A second menu includes a fit packet.
- This allows you to match different functions to the data set:
- 1)Polynomial (like a parabola)
- 2)Exponential function (like Y =height*exp(const.*X),or a Gauss-curve.
- 3)Power function (like Y=const.* x^power)
- 4) multibles ( <=3) overlaying Gauss-curves.
- At the most 10 parameters will be matched.
- The match may consider the error in the Y value or the absolute or
- relative disgression of the Y value from the curve. The matched data
- set may then be supplied with specification by one or more X values
- by using the mouse.
-
- A third menu allows you to manipulate the data set:
- 1)Addition, Subtraction, Division, Multiplication of the Y value.
- 2)Copy, Combine, Erase data sets
- 3)Invert Y value, exchange X and Y value, sort, averaging neighboring
- points, calibration of the X and Y values.
- 4)Replace, erase, calibrate and averaging ranges of a data set.
- 5)Transformation of cartesian coordinates (X,Y) to polar coordinates
- or the reverse, as the rotation and mirroring of the X,Y pair.
-
- Examples and possible problems are at the end of this document.
-
- Short description of each of the PLOT-MENUES
- --------------------------------------------
- DESK-Menu
- =========
- Return to the desktop by selecting DESK or to Basic by the BASIC
- option.
- Before calling accesorries be sure to save the screen by using
- the BUFFER option from the OUTPUT-Menu and then restore it with
- the BUFFER option from the INPUT-Menu.
-
- INPUT-Menu:
- ===========
- The input may be from a file, the keyboard or the mouse.
- X-values may automatically be produced by the program. If input
- is by mouse, the X- and Y- scales must have been defined by using
- the X-RANGE and Y-RANGE or they must been established thru previous
- input. The option COEFF allows input of the coefficients of a
- polynomial (see FIT). With the help of those coeffiecents a data
- set (X-,Y- value pair) may then be created.
-
- Errors for the Y value can be input as either absolute or relative
- ( in %). These are identified by the input of a "%".
- The option ERROR makes Y-errors possible, that are build tru roots
- (Y)-statistical error.
-
- Later changes are possible by using the option CHANGE from the
- INPUT menu.
- While in CHANGE, individual points may be changed by using the
- mouse or the keyboard. You may also change individual coefficients
- by selecting COEFF from the INPUT-Menu. It it also possible to
- append or merge data from another data set. The option CHANGE
- performs all changes to the data set that was chosen in the DATA
- SET option (the current data set graphically displayed).
-
- The option TEXT makes it possible to include your own text into
- the picture (maximum of 10 lines). These lines may be changed
- or deleted thru the CHANGE option within the INPUT menu. ( You may
- use the backspace to change text or use the mouse to change the
- position of the text.
-
- The option DATA SET allows you to select the data set that will
- be used for the display (Pick data set number, replace current
- data set with new data set).
-
- OUTPUT-Menu:
- ------------
- Data may be output to the screen, printer or a file. The HARDCOPY
- routine creates copies which are turned 90 degrees, and are 1.8
- times as large as normal hardcopies. The first time HARDCOPY is
- called the printer type must be selected (IBM or Epson). When
- using medium resolution the grey will be red and blue. You can
- always use the ALTERNATE HELP to get a normal hardcopy.
-
- The OUTPUT menu also contains an Integration routine.
- SUM Y adds all Y values within a X range and calculates the
- mean and the X- median (SUM X(i)*Y(i) / Sum Y(i) ). INTEGRATE
- is useful to compute the sum Y(i)*Delta-X(i).
-
- Through the DATA SET option, the mode of all OUTPUT options of
- active data sets may be chosen.
-
- The option FIT selects the FIT menu (see below).
-
- You can use the option BUFFER to store the screens. The actual data
- fields are not changed only the X- and Y- scales. You may therefore
- put more graphs into a buffered picure by using the option ADD from
- the DRAW menu.
-
- X-SCALE Menu
- ============
- RANGE allows you to input the axis range by using the keyboard
- or the mouse.
- AUTO selects the range according to the data. Once AUTO is
- deactivated the previous set range goes into effect. If no
- range was specified than the range will be set automatically.
- LOG turns on the logarithmic display of the data set.
- CALIBRATE recomputes the X values (X-new = X-old * slope + Offset.
- A RETURN without a value makes slope=1 and offset=0.
- EXPAND allows you to increase the range via the mouse. The X values
- are not changed and the range selected by AUTO remains intact.
- MARKER turns vertical help lines on and off. They do not become
- visible until NEW or FRAME is selected from the DRAW menu.
-
- Y-SCALE Menu
- ============
- see X-SCALE Menu.
- Instead of EXPAND you must use the ZOOM option to enlarge the
- picture. Select the start and ending positions with the click
- of the mouse.
-
- DRAW-Menu:
- =========
- NEW erases the screen and plots a graph based on the range selected
- thru the X-SCALE and Y-SCALE Menus.
- ADD allows you to add more graphs into the same picture. The ranges
- are not changed.
- FRAME draws only the X- and Y-axis. The screen is erased.
- FIT allows you to add the last match to the existing screen. The
- line form of the fitcurve may selected by using option LINE
- from the STYLE Menu.
- DATA SET allows you to pick the data set. Data set is displayed in
- the top right corner.
- NEXT switches the the next data set. When the last data set is
- reached, the first data set will again be chosen.
- PREVIOUS select the previous data set. This wraps around to the last
- data set from first.
- TEXT allows you to turn the display of text on and off during
- graphic display.
- ERROR turns the Y-ERROR bars on and off.
-
- STYLE-Menu:
- ===========
- The selected style from option TEXT is only active for labels, which
- are inserted somewhere into the screen by using option TEXT from
- the INPUT Menu.
- Lines and symbols may be combined by selecting them from the STYLE
- Menu and adding them thru the option ADD from the DRAW menu.
- The option COLOR allows you to select different color for text and
- lines.
-
- All other options are self explanatory (maybe).
-
- Greek letters and other signs may be added by pressing Control S
- and any other letter of your choice. (K=Delta, J=Omega, H=Phi, etc).
-
- Short description of the FIT Menu:
- ----------------------------------
-
- FUNCTION
- ========
- Selects the fit functions (match functions) and allows you to
- select up to ten fit parameters. The default is 2.
-
- This fits a polynomial (option LINEAR, EXPONETIAL, POWER LAW ).
- Thru this the Y values can become logarithmical (option EXPONENTIAL)
- or the X- and Y- values (option POWER LAW). Errors will always be
- correctly changed.
- Attention:In the case of option POWER LAW negative values ((X-X0) < 0)
- will not be evaluated during the curve fitting. Negative Y-values
- with option EXPONENTIAL and POWER LAW will be replaced by the
- maximum of the Y axis/100000 (linear Y axis) or the minimum of
- the Y axis/10 (logarithmic Y axis)!
-
- In the case of a Gauss-curve, the height, position of the maximum,.
- median and area of the Gauss-curve will be computed from the fit
- parameters (option EXPONENTIAL,3,coefficient).
-
- With the option GAUSS-FUNCT. you may match one or many Gauss curves.
- a non linear match system is used. This requires the input of starting
- values (position, height and mean of the Gauss-curve). This method
- is more complicated but also more accurate. If the start values are
- to far from the optimal value, the solving process may last forever
- and the fitting is interrupted.
-
- The option TEST-FUNCTION allows you to apply a previous selected
- function to the data. The function itself can be specified thru
- input of coefficients by using the INPUT menu or thru another
- data set.
-
- The option X-REFERENCE allows you to select a reference point (X0)
- for the fit parameters.
- Attention: The option POWER LAW requires positive values (X-X0)
- within the fit range (see above).
-
- Option FIT performs the selected functions on the data, whereby the
- mean deviation (CHI**2) is minimized. If the statistical error of
- the data is taken into account (see: Menu WEIGHT), the probability
- is computed that will correctly describe the data (values between
- 5% and 95% are possible).
-
- WEIGT
- =====
- Specifies the weight that is assigned to each data point.
- Y-ERROR: Previously entered errors of the Y values will be used
- as the weight.
- ABSOLUTE: The deviation of the data points from the fit curve is
- minimized.
- RELATIVE: The relative deviation of the data points from the fit
- curve are minimized.
- Attention: With option ERROR and RELATIVE the smallest weight factor
- is (y-max - Y-min)/10000 with linear or Y-min/1000 with
- logarithmic Y-axis. Smaller weight factors will be
- replaced by these values!
-
- REGION
- ======
- Specifies the range of the data that will be used to fit the curve:
- ALL: All data points.
- DISPLAY: Range of current data displayed.
- NEW: Select X range with the mouse.
- APPEND: Add additional X ranges (maximum of 10).
- SHOW: shows thru markers the X ranges that were selected with
- NEW or APPEND option. At the same time these ranges are
- reactivated in case the option ALL or DISPLAY were
- previously active.
- DATA SET: Specifies the data set or sets to which the fit curve
- should be applied to. The currently displayed data set is
- the default.
-
- STORE:
- ======
- Allows you to save the X- and Y- results of the fit as a data set.
- The option CREATE allows you to pick your own X range.
- Option SUBTRACT subtracts the fit result from the data set.
- Option DIVIDE divides the data with the fit result.
- Option DATA SET selects the data set in which the result is saved.
- If no data set is specified a new data set is created.
-
- DRAW:
- =====
- see main menu.
- Option Buffer is also present (see INPUT menu in the main menu.
-
- OUTPUT:
- =======
- Allows you to print the result of the fit to the printer (option
- PRINT), the screen (option SCREEN) or the disk drive (option FILE).
-
- The mean deviation of the data within a given range can also be
- specified ( option SUM-ERROR).
-
- The option X -> Y calculates the Y value for a give X value. The
- error of the Y fit value is also calculated. This makes it possible
- to estimate the values that are past the visible range.
-
- Option MAIN MENU returns you to the main menu.
-
- Note:
- -----
- The menu STORE and OUTPUT are also active if a set of coeffiecents
- were previously entered thru the keyboard (option COEFF from the
- INPUT menu). The errors are set to null in this case.
-
-
- Short description of menus from MENU III.
- -----------------------------------------
-
- CREATE
- ======
- The currently displayed data set is combined with another data set
- (see below). The result will be put in a new data set or an old
- data set will be overwritten (option DATA SET).
- ADD: Addition or subtraction of the Y values between two data
- sets. The Y values of the second data set may be multiplied
- by a factor value.
- DIVIDE: Division of the Y values between two data sets.
- MULTIPLY: Multiply the Y values of two data sets.
-
- In all three cases will the error of the resulting Y values be
- calculated from the errors of the output values. If more than one
- data set is displayed than only the last one will be used.
- If the X values of the data sets are not identical, the Y values
- of the second data set will be adjusted.
-
- COPY: Copies one or more data sets to a new data set.
- MERGE: Merges the selected data set into the displayed data set.
- It is merged by the size of the X value. The relative order
- of the value pairs of the two data sets remains unchanged.
- Attention: The number of the new data set should not be
- identical to the number of either output data set!
-
- DELETE:
- =======
- To erase all of the data set or the text of the data set.
-
- CHANGE:
- =======
- Changes to contents of a data set.
- INVERT: Replaces the Y values by 1 / Y value.
- Y-errors, ranges, text coordinates will also be recalculated.
- SWAP X, Y: Switches the X and Y values. This option can also be used
- to display error result for the X values.
- CALIBRATE X: linear allignment of the X values: X-new = X-old*slope
- + Offset.
- CALIBRATE Y: Linear allignment of the Y values.
- AVERAGE: Creates the average of the two neigboring points. If the
- Y values are given with error results, a weighted average
- will be performed so that the errors of the Y average is
- minimized. If the number of data points is not even, the
- last value will be taken as is.
- SMOOTH: Three Y values are averaged. The number of values remains
- unchanged [ Y(i)=( Y(i-1) + 2*Y(i) + Y(i+1) )/4 ].
- Attention: The data points are not statistically independent
- after a SMOOTH operation!
- INTEGRATE: Numeric integration thru the X-, Y- value function:
- Y-new(n) = Sum(Y(i)*delta-X(i)), i=1-n.
- Attention: depending on the distant between the points on
- the X axis, large Y values may be created. Calibrating
- these values by using the option CALIBRATE Y is sinful.
-
- REGION
- ======
- Changes a data set only within the selected range.
- REPLACE: Replaces the data points of the displayed set or sets with
- the values of another data set with values in the same
- range. The marked range of the displayed data set is not
- required to contain points. In this case the points of
- the second data set will be inserted or added.
- DELETE: Erases all points of the chosen X range.
- CALIBRATE X: Calibrates the data points of selected range on the
- X axis (see X-SCALE).
- CALIBRATE Y: Same as previous except (Y-SCALE).
- AVERAGE: Computes the average between the two neighboring points
- within a selected range.
- If more than one data set is displayed, then all above operations
- are performed for all displayed data sets.
-
- TRANSFORM:
- ==========
- X-Y -> `-R: Transforms cartesian coordinates (X,Y) into polar
- coordinates (angle, radius). A circle will for example
- be transformed to a horizontal incline. Angles are
- given in degrees.
- `,R -> X-Y: Transforms polar coordinates into cartesian coordinates.
- A incline with a slope <>0 would for example be
- transformed into a spiral. Example: input of the
- smallest radius (example 10) and the increments of
- the radius per degree (example 0.1) thru the COEFF
- option. LINEAR from the INPUT menu and a choice for the
- Theta value X-min=0, X-max=1080 with increment=10.
- ROTATE: Rotate the value pair clockwise by the given angle.
- MIRROR: Mirror the X and Y values of the displayed data set or
- sets thru the X-Y CENTER.
- X,Y-CENTER: Sets the orgin from which the data is rotated. (Default:
- X=0, Y=0 ).
- Errors for the Y values are not taken into account during any of
- the above functions.
-
- File-Structure:
- ===============
- The data file must have the extension .DAT. It can reside in a folder
- as well as a folder within a folder.
-
- The data file can contain many different options or comments before
- the actual data set.
- Options are identified by key words followed by the option:
- X-RANGE:X-min,X-max
- Y-RANGE:Y-min,Y-max
- X-TEXT:X-axis text
- Y-TEXT:Y-axis text
- STYLE:Symbol-flag, Histogram-flag, style-Nr, Line-width, Line-Color
- LABLE:Lable Text (anywhere on the screen)
- X-Position, Y-Position, Text-style (1-31), Text-size (4,6,13,32)
-
- All lines that do not begin with a keyword will be treated as
- comments. The first Comment line will be saved and transferred to
- the Output-File, all others are ignored.
-
- The start of the data fields begin with the keyword DATA:
- Example: DATA:X,Y(,Y-ERROR or X-ERROR)
- (The optional keyword X-ERROR identifies that Error results ( 3
- numbers per line) are for the X values.
- The following input values will automatically be tested for input
- error.)
- X value, Y value, Y-error or
- X value, Y value or
- X value, Y value or
- X value, Y value, X-error
- No special mark to signify the end of the data set is needed. A
- empty line after the data set will result in an error message.
-
- END: needed to seperate more than one data set within the same file.
- (It may be the only thing after the data, but further input is
- then ignored.)
-
- Keywords do not have to be capitilized. The option FILE from the
- OUTPUT menu creates these data files.
-
- Changing the default program parameters:
- ========================================
- The file PLOTFIT.MON or PLOTFIT.COL contain the disk drive default
- and dimension for data fields (size of data sets) in line 1.
- Line 2 contains the screen coordinates used for graphic.
- The dimension variables follow along with the keywords for the
- menus.
- The Symbol table of the graphic symbols is on the end.
-
- Possible Problems!!
- ===================
- If the Menu row is frozen after a command, a short click with the
- mouse will unlock it.
- Multiple inputs with the mouse are terminated by pressing the right
- mouse button.
- If everything else fails try pressing the RETURN key.
- The old value usually remains in tact when pressing the RETURN
- with any input; Exception: X- Y- axis marking.
- In the case of an error it is best to return to the menu. If nothing
- else works you may save data and start from the beginning.
- If hardcopy does not work, turn printer of and on.
- To fit a data set with the EXPONENTIAL or POWER LAW function
- requires positive X or X and Y values. You may have to expand the
- range using the EXPAND from the X-SCALE menu. If the program is
- too much pressure on your nerves, just erase the program.
-
- Example Program:
- 1) Load TEST2.DAT by selecting FILE from the INPUT menu. Plot the
- yearly taxes of Hans Zahlemann by selecting NEW from the DRAW menu.
- Compute the yearly average from the years 197801984 by selecting
- INTEGRATE from the OUTPUT menu. All taxes for this range are
- automatically computed.
- Select FIT from the OUTPUT menu. By selecting EXPONENTIAL from the
- FUNCTION menu (Number of Fit parameters=2) and then picking from
- FIT, you will receive a adjustment curve that will allow you to
- inspect the future and the past. (option X -> Y).
-
- Select MAIN MENU and then X-SCALE (1930-2030) and then Y-SCALE
- (0-65000) to see the predicted curve of your taxes. The screen
- text will also change, but you may discard it it by using the
- TEXT option from the DRAW menu.
- The FIT option in the DRAW menu will tell you the predicted taxes
- to your country. The option MOUSE from the OUTPUT menu will give
- you more accurate information.
- The CREATE option in the STORE menu allows you to save the results
- as a data set.
-
- 2) Load TEST1.DAT and fit a Gauss curve in the peak. Then select
- the range by using the NEW option in the region menu. Then
- select EXPONENTIAL from the FUNCTION menu and specify the number
- of fit coefficients (# OF COEFF. = 3.
- The height, width and position of the gauss curve is obtained
- by selecting the SCREEN or PRINT option from the OUTPUT menu.
- Compare the mean deviation CHI with the result by using the
- GAUSS-FUNCT.
-
- Have fun!
- Wolgang Koenig, am Bruehl 1, 6101 Messel, Tel. 6159-1476, December 86
-
- PS. The internal hardcopy command should work without any problem
- on Epson and IBM compatible printers. (see your printer documentation
- for more information).
-
- Translated to English by Wilford Niepraschk.
-