
Developing Statistical Software in Fortran 95
By: David R. Lemmon, Joseph L. Schafer
Paperback | 6 May 2005
At a Glance
336 Pages
22.23 x 14.61 x 1.27
Paperback
$169.75
or 4 interest-free payments of $42.44 with
orShips in 5 to 7 business days
Many books teach computational statistics. Until now, however, none has shown how to write a good program. This book gives statisticians, biostatisticians and methodologically-oriented researchers the tools they need to develop high-quality statistical software.
Topics include how to:
Program in Fortran 95 using a pseudo object-oriented style
Write accurate and efficient computational procedures
Create console applications
Build dynamic-link libraries (DLLs) and Windows-based software components
Develop graphical user interfaces (GUIs)
Through detailed examples, readers are shown how to call Fortran procedures from packages including Excel, SAS, SPSS, S-PLUS, R, and MATLAB. They are even given a tutorial on creating GUIs for Fortran computational code using Visual Basic.NET.
This book is for those who want to learn how to create statistical applications quickly and effectively. Prior experience with a programming language such as Basic, Fortran or C is helpful but not required. More experienced programmers will learn new strategies to harness the power of modern Fortran and the object-oriented paradigm. This may serve as a supplementary text for a graduate course on statistical computing.
From the reviews:
"This book should be read by all statisticians, engineers, and scientists who want to implement an algorithm as a computer program. The book is the best introduction to programming that I have ever read. I value it as one of my important reference books in my personal library." Melvin J. Hinich for Techonmetrics, November 2006
"Overall, the book is well written and provides a reasonable introduction to the use of modern versions of Fortran for statistical computation. The real thrust of the book is building COM interfaces using Fortran, and it will no doubt be most useful to anyone who needs to build such interfaces." Journal of the American Statistical Association, June 2006
"The book is well written and is divided into chapters and sections which are coherent...Overall the book seems like a good resource for someone that already knows some dialect of FORTRAN and wants to learn a bit about what is new in FORTRAN 95..." Robert Gentleman for the Journal of Statistical Software, December 2006
Industry Reviews
From the reviews:
"This book should be read by all statisticians, engineers, and scientists who want to implement an algorithm as a computer program. The book is the best introduction to programming that I have ever read. I value it as one of my important reference books in my personal library." Melvin J. Hinich for Techonmetrics, November 2006
"Overall, the book is well written and provides a reasonable introduction to the use of modern versions of Fortran for statistical computation. The real thrust of the book is building COM interfaces using Fortran, and it will no doubt be most useful to anyone who needs to build such interfaces." Journal of the American Statistical Association, June 2006
"The book is well written and is divided into chapters and sections which are coherent...Overall the book seems like a good resource for someone that already knows some dialect of FORTRAN and wants to learn a bit about what is new in FORTRAN 95..." Robert Gentleman for the Journal of Statistical Software, December 2006
"The purpose of this book is to help statisticians, (theory and) application-oriented developers, and researchers who need statistical computer programs to write a good FORTRAN program for the first time. Since good programming style can be taught and learned, the authors try for their potential readers to get into the experience of developing FORTRAN applications as quick, painless and rewarding as possible." (Silvia Curteanu, Zentralblatt MATH, Vol. 1076, 2006)
"This book is designed to teach applied statisticians how to write reliable, maintainable and re-usable programs using modern Fortran, and how to access these programs from other software. ... I heartily recommend this book to anyone wishing to develop modern statistical software in Fortran - even those with considerable experience will learn something from it. For anyone used to writing long subroutines in FORTRAN 77, itshould be considered compulsory. The style is engaging ... and the use of statistical examples and exercises very helpful." (Len Thomas, Journal of Applied Statistics, Vol. 34 (3), 2007)
"Fortran is still unrivalled with respect to computing speed. ... Its aim is rather to present instructions for writing good programs. ... The text is written very readably. The explanations always take place along well-chosen example applications. The book makes undoubtedly a persuasive case for choosing Fortran for programming statistical software. ... it offers enough suggestions and instructions for creating good programs that it is to be recommended to all who program statistically." (Rainer Schlittgen, Advances in Statistical Analysis, Vol. 91, 2007)
| Preface | p. v |
| Motivation | p. 1 |
| Why We Wrote This Book | p. 1 |
| For Whom We Are Writing | p. 2 |
| Those Accustomed to Fortran 77 | p. 2 |
| Those Who Want to Create Windows Applications | p. 2 |
| Those Who Want to Interface Fortran with Other Applications | p. 3 |
| The Need for Good Programming Practice | p. 4 |
| Programming for Research Dissemination | p. 4 |
| Programming Standards | p. 4 |
| Benefits of Good Programming Style | p. 5 |
| Benefits of Uniformity | p. 5 |
| Why We Use Fortran | p. 6 |
| History of Fortran | p. 6 |
| Fortran's Advantages | p. 6 |
| Useful New Features | p. 7 |
| What this book does not cover | p. 7 |
| Differences Between Fortran 90 and Fortran 95 | p. 7 |
| Pseudo Object-Oriented Programming in Fortran | p. 8 |
| Fortran 2003 | p. 8 |
| Which Compiler Should I Use? | p. 8 |
| Developing Applications for a Broad Audience | p. 9 |
| Console Applications and COM Servers | p. 9 |
| COM Servers and Clients | p. 10 |
| Scope of the Rest of This Book | p. 11 |
| Our Source Code and Web Site | p. 12 |
| Introduction to Modern Fortran | p. 13 |
| Getting Started | p. 13 |
| A Very Simple Program | p. 13 |
| Fixed and Free-Form Source Code | p. 15 |
| Compiling, Linking and Running | p. 15 |
| Compiler Options | p. 17 |
| Standard Input and Output | p. 19 |
| Intrinsic Uniform Generator | p. 20 |
| Integer and Real Kinds | p. 20 |
| Do, if, case, goto | p. 22 |
| Exercises | p. 25 |
| Arrays | p. 26 |
| Rank, Size and Shape | p. 26 |
| Array Functions | p. 27 |
| Operations on Arrays and Array Sections | p. 28 |
| Your Mileage May Vary | p. 29 |
| Array Allocation | p. 30 |
| Exercises | p. 31 |
| Basic Procedures | p. 32 |
| Subroutines | p. 32 |
| Assumed-Shape and Optional Arguments | p. 33 |
| Functions | p. 36 |
| Pure, Elemental and Recursive Procedures | p. 38 |
| On the Behavior of Local Variables | p. 39 |
| Exercises | p. 41 |
| Manipulating Character Strings | p. 42 |
| Character Variables | p. 42 |
| Assigning, Comparing, and Concatenating Strings | p. 43 |
| More String Functions | p. 44 |
| Internal Files | p. 45 |
| Exercises | p. 46 |
| Additional Topics | p. 47 |
| Expressions with Mixed Types and Kinds | p. 47 |
| Explicit Type Conversion | p. 48 |
| Generic Procedures | p. 49 |
| Don't Pause or Stop | p. 50 |
| Additional Exercises | p. 50 |
| A Pseudo Object-Oriented Style | p. 55 |
| Basic Concepts of Object-Oriented Programming | p. 56 |
| Objects and Classes | p. 56 |
| Properties | p. 56 |
| Put and Get | p. 57 |
| Methods and Constructors | p. 57 |
| Conceptualizing an Interface | p. 58 |
| Other Object-Oriented Concepts | p. 60 |
| Exercises | p. 60 |
| Modules | p. 61 |
| What Is a Module? | p. 61 |
| How Not to Use Modules | p. 62 |
| How to Use Modules | p. 64 |
| Generic Module Procedures | p. 65 |
| Exercises | p. 66 |
| Derived Types | p. 67 |
| What Is a Derived Type? | p. 67 |
| Using Derived Types | p. 69 |
| Constructors and Default Initialization | p. 71 |
| Exercises | p. 73 |
| Pointers | p. 73 |
| Fear Not the Pointer | p. 73 |
| Pointer Assignment | p. 74 |
| Pointer Status | p. 76 |
| Pointer Allocation | p. 77 |
| Pointer Deallocation | p. 77 |
| Memory Leaks | p. 78 |
| Exercises | p. 79 |
| Why We Need Pointers | p. 79 |
| Pointers in Derived Types | p. 79 |
| Pointers as Dummy Arguments | p. 80 |
| Recursive Data Structures | p. 82 |
| Procedures for Linked Lists | p. 83 |
| Exercises | p. 86 |
| Example Module: A Generic Error Handler | p. 88 |
| Strategy for Managing Run-Time Errors | p. 88 |
| Structure of the Module | p. 89 |
| Module Procedures | p. 91 |
| Using the Module | p. 96 |
| General Guidelines for Modules | p. 99 |
| Additional Exercises | p. 100 |
| Implementing Computational Routines | p. 101 |
| Issues of Numerical Accuracy | p. 101 |
| Accuracy Is Crucial | p. 101 |
| Floating-Point Approximation | p. 102 |
| Roundoff and Cancellation Error | p. 103 |
| Arithmetic Exceptions | p. 104 |
| Resources for Numerical Programming | p. 106 |
| Exercises | p. 106 |
| Example: Fitting a Simple Finite Mixture | p. 109 |
| The Problem | p. 109 |
| Programming Constants | p. 110 |
| A Computational Engine Module | p. 111 |
| A Public Procedure With Safeguards | p. 112 |
| The Computations | p. 114 |
| Strategies for Calling the Engine | p. 115 |
| A Simple Calling Program | p. 116 |
| Test, and Test Again | p. 118 |
| Exercises | p. 119 |
| Efficient Routines at Lower Levels | p. 120 |
| What Is a Lower-Level Procedure? | p. 120 |
| Keeping Overhead Low | p. 121 |
| Taking Advantage of Structure | p. 122 |
| Loop Reordering, Stride and Saxpy | p. 123 |
| Optimization, Pipelining and Multiple Processors | p. 125 |
| A Simple Example | p. 126 |
| Hidden Allocation of Temporary Arrays | p. 127 |
| Exercises | p. 128 |
| More Computational Procedure Examples | p. 128 |
| An Improved Cholesky Factorization | p. 128 |
| Inverting a Symmetric Positive-Definite Matrix | p. 130 |
| Weighted Least Squares | p. 132 |
| Computational Routines in Object-Oriented Programming | p. 134 |
| Additional Exercises | p. 136 |
| Developing a Console Application | p. 139 |
| A Program for Logistic Regression | p. 140 |
| The logistic regression model | p. 140 |
| Motivation for the ELOGIT Console Program | p. 140 |
| Dependency Map for Source Components | p. 140 |
| Developing Program Units Incrementally | p. 141 |
| Where to Begin | p. 142 |
| Before You Start | p. 142 |
| Program Constants | p. 143 |
| The Control File Interface | p. 144 |
| First Snapshot of ELOGIT | p. 148 |
| Exercises | p. 150 |
| Starting the Main Types Module | p. 151 |
| An Object-Oriented Design | p. 151 |
| Storing the Dataset | p. 152 |
| A Module for Pointer Allocation | p. 156 |
| Putting and Getting Data | p. 158 |
| Reading Data from Files | p. 163 |
| Second Snapshot of ELOGIT | p. 165 |
| Exercises | p. 167 |
| Specifying the Model | p. 167 |
| Storing the Model Specification | p. 167 |
| Putting and Getting Model Properties | p. 168 |
| Third Snapshot | p. 172 |
| Exercises | p. 175 |
| Fitting the Model | p. 176 |
| The Computational Task | p. 176 |
| Newton-Raphson and Weighted Least Squares | p. 176 |
| Parameters and Results | p. 178 |
| The Model-Fitting Procedure | p. 179 |
| Reporting the Results | p. 183 |
| Looking Ahead | p. 188 |
| Additional Exercises | p. 188 |
| Creating and Using Dynamic-Link Libraries | p. 191 |
| Extending the Functionality of Statistical Packages with Fortran DLLs | p. 191 |
| Compiled Procedures Run Faster | p. 191 |
| When to Use a DLL | p. 192 |
| Understanding Libraries | p. 193 |
| Source-Code Libraries | p. 193 |
| Static Libraries | p. 194 |
| Dynamic-Link Libraries | p. 194 |
| How Programs Use DLLs | p. 195 |
| Locating the DLL | p. 195 |
| DLL Hell | p. 196 |
| Dynamic Loading and Linking | p. 196 |
| Load-Time and Run-Time Linking | p. 197 |
| Creating a Fortran DLL | p. 198 |
| The Basic Steps | p. 198 |
| Passing Arguments | p. 198 |
| Calling Conventions | p. 199 |
| Compiling and Linking the Source Code | p. 201 |
| Compiler Options | p. 202 |
| Example: a Fortran DLL for Fitting an Exponential Mixture | p. 202 |
| Creating a Wrapper | p. 202 |
| Building the DLL with Intel Visual Fortran and Lahey/Fujitsu Fortran | p. 207 |
| Building with Salford Fortran | p. 209 |
| Calling the DLL Procedure from S-PLUS and R | p. 211 |
| Calling the Function from SAS/IML | p. 214 |
| Shared Objects in Unix and Linux | p. 216 |
| An Example: Extending S-Plus and R via a Fortran Shared Object in Linux | p. 217 |
| Creating COM Servers | p. 219 |
| A Simple Example | p. 220 |
| The magic8 Fortran Module | p. 220 |
| The Magic8 COM Server | p. 222 |
| Installing the Magic8 COM Server | p. 222 |
| The 8-Ball Speaks in Excel | p. 223 |
| The 8-Ball Speaks in S-PLUS and R | p. 225 |
| The 8-Ball Speaks in MATLAB | p. 226 |
| The 8-Ball Speaks in SAS | p. 227 |
| Exercises | p. 228 |
| COM Server Basics | p. 228 |
| References on COM | p. 228 |
| COM, Windows, and .NET | p. 228 |
| COM Servers versus Conventional DLLs | p. 229 |
| The Object-Oriented Contract | p. 230 |
| In-Process versus Out-of-Process Servers | p. 231 |
| Example: A COM Server for Logistic Regression | p. 233 |
| Producing COM Servers with Intel Visual Fortran | p. 233 |
| Getting Ready | p. 233 |
| Naming the Server and the Class | p. 234 |
| Fortran Style Conventions | p. 235 |
| Automatically Generating the COM Server Code | p. 236 |
| Building the Project in Visual Studio | p. 237 |
| Building and registering the server | p. 243 |
| Creating a Simple Client | p. 245 |
| Exercises | p. 248 |
| How the Fortran COM Server Works | p. 249 |
| Overview of the Automatically Generated Code | p. 249 |
| The Interface Definition Language File | p. 250 |
| The Instance Code | p. 250 |
| The Interface Code | p. 253 |
| Passing Arrays as Variants | p. 255 |
| How the COM Server Handles Errors | p. 259 |
| Distributing and Installing COM Servers | p. 260 |
| Additional Exercises | p. 262 |
| Creating COM Clients | p. 265 |
| An Improved Client for Excel | p. 265 |
| Excel As a Graphical User Interface | p. 265 |
| Starting to Write the Client | p. 266 |
| How Did It Work? | p. 269 |
| Debugging the Client and Server | p. 270 |
| Finishing the Excel Client | p. 274 |
| Exercises | p. 277 |
| Clients for Other Environments | p. 277 |
| Keeping It Simple | p. 277 |
| Clients for S-PLUS and R | p. 277 |
| A Client for SAS | p. 281 |
| SPSS | p. 288 |
| MATLAB | p. 293 |
| Creating a Standalone GUI Application | p. 296 |
| Component-Based Design | p. 296 |
| Visual Basic .NET | p. 296 |
| An XML Data Format | p. 296 |
| Starting the Graphical Interface | p. 298 |
| Reading the Data File | p. 299 |
| Specifying the Model | p. 301 |
| Invoking the Model Fit Procedure | p. 304 |
| Displaying the Results | p. 308 |
| Finishing Up | p. 312 |
| Exercises | p. 312 |
| References | p. 315 |
| Table of Contents provided by Ingram. All Rights Reserved. |
ISBN: 9780387238173
ISBN-10: 0387238174
Series: STATISTICS AND COMPUTING
Published: 6th May 2005
Format: Paperback
Language: English
Number of Pages: 336
Audience: Professional and Scholarly
Publisher: Springer Nature B.V.
Country of Publication: US
Dimensions (cm): 22.23 x 14.61 x 1.27
Weight (kg): 0.48
Shipping
| Standard Shipping | Express Shipping | |
|---|---|---|
| Metro postcodes: | $9.99 | $14.95 |
| Regional postcodes: | $9.99 | $14.95 |
| Rural postcodes: | $9.99 | $14.95 |
Orders over $79.00 qualify for free shipping.
How to return your order
At Booktopia, we offer hassle-free returns in accordance with our returns policy. If you wish to return an item, please get in touch with Booktopia Customer Care.
Additional postage charges may be applicable.
Defective items
If there is a problem with any of the items received for your order then the Booktopia Customer Care team is ready to assist you.
For more info please visit our Help Centre.
You Can Find This Book In
This product is categorised by
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentProgramming & Scripting Languages
- Non-FictionMathematicsProbability & Statistics
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentSoftware Engineering
- Non-FictionComputing & I.T.Business ApplicationsMathematical & Statistical Software
- Non-FictionMathematicsApplied Mathematics
- Non-FictionEngineering & TechnologyElectronics & Communications EngineeringElectronics Engineering
- Non-FictionComputing & I.T.Computer Programming & Software DevelopmentCompilers & Interpreters
- Non-FictionComputing & I.T.Computer ScienceArtificial Intelligence
- Non-FictionMathematicsCalculus & Mathematical AnalysisNumerical Analysis
























