Информационный сервер для программистов: Исходники со всего света. Паскальные исходники со всего света
  Powered by Поисковый сервер Яndex: Найдется ВСЁ!
На Главную Pascal Форум Информер Страны мира
   Математика    >>    regress
   
 
 Linear Regression (best line fit) on an ASCII-file   Josh Mitteldorf 13.06.1988

Модуль для проведения Линейного Регрессионного анализа. Входные данные должны быть помещены в текстовый файл. В комплект входит модуль матричных операций.
This program performs a linear regression (best line fit) on an ASCII-formatted file (like matrix). Added Matrix Operations Unit.



7k 
 

REGRESSFILE UNIT Josh Mitteldorf 6800 Scotforth Rd Philadelphia, PA 19119 70441,1305 } Performs a linear regression (best line fit) on an ASCII-formatted file. File should be organized in columns, with only whitespace between the columns. You may specify at run time which column contains the dependent variable and which contains the independent variables. Columns which are not specified as either are read in and skipped. They may contain non-numeric data without causing an error. However, non-numeric data in any variable cell will cause an entire row of numbers to be skipped over, with a message to the user. If a row is found with more or less than the specified number of columns, the program attempts to skip that row and move on.} MATRIX UNIT Josh Mitteldorf 6800 Scotforth Rd Philadelphia, PA 19119 70441,1305 } You can change the definition of float above, to real or single or extended, and all computations will be to the specified precision. You must change to float = real in order to run this unit without a coprocessor. In all these procedures and functions, the last argument d is the dimension. All matrices are square, of dimension d x d. Everything is accessed as a pointer in order to facilitate the flexibility of being able to specify d when the procedure is called. Thus matrix and vector are just two different names for the same thing, namely a pointer to array of type float. The calling unit may be structured as follows: const n=4; type float=real; vector=array[1..n] of float; matrix=array[1..n] of vector; var x,y :vector; z :matrix; ... Prod(addr(z),addr(x),addr(y)); ... Then the element z[i,j] in the calling unit becomes