Mastering Scientific Computing with R
eBook - ePub

Mastering Scientific Computing with R

Paul Gerrard, Radia M. Johnson

Share book
  1. 432 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Mastering Scientific Computing with R

Paul Gerrard, Radia M. Johnson

Book details
Book preview
Table of contents
Citations

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Mastering Scientific Computing with R an online PDF/ePUB?
Yes, you can access Mastering Scientific Computing with R by Paul Gerrard, Radia M. Johnson in PDF and/or ePUB format, as well as other popular books in Ciencia de la computación & Lenguajes de programación. We have over one million books available in our catalogue for you to explore.

Information

Mastering Scientific Computing with R


Table of Contents

Mastering Scientific Computing with R
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Programming with R
Data structures in R
Atomic vectors
Operations on vectors
Lists
Attributes
Factors
Multidimensional arrays
Matrices
Data frames
Loading data into R
Saving data frames
Basic plots and the ggplot2 package
Flow control
The for() loop
The apply() function
The if() statement
The while() loop
The repeat{} and break statement
Functions
General programming and debugging tools
Summary
2. Statistical Methods with R
Descriptive statistics
Data variability
Confidence intervals
Probability distributions
Fitting distributions
Higher order moments of a distribution
Other statistical tests to fit distributions
The propagate package
Hypothesis testing
Proportion tests
Two sample hypothesis tests
Unit root tests
Summary
3. Linear Models
An overview of statistical modeling
Model formulas
Explanatory variables interactions
Error terms
The intercept as parameter 1
Updating a model
Linear regression
Plotting a slope
Analysis of variance
Generalized linear models
Generalized additive models
Linear discriminant analysis
Principal component analysis
Clustering
Summary
4. Nonlinear Methods
Nonparametric and parametric models
The adsorption and body measures datasets
Theory-driven nonlinear regression
Visually exploring nonlinear relationships
Extending the linear framework
Polynomial regression
Performing a polynomial regression in R
Spline regression
Nonparametric nonlinear methods
Kernel regression
Kernel weighted local polynomial fitting
Optimal bandwidth selection
A practical scientific application of kernel regression
Locally weighted polynomial regression and the loess function
Nonparametric methods with the np package
Nonlinear quantile regression
Summary
5. Linear Algebra
Matrices and linear algebra
Matrices in R
Vectors in R
Matrix notation
The physical functioning dataset
Basic matrix operations
Element-wise matrix operations
Matrix subtraction
Matrix addition
Matrix sweep
Basic matrixwise operations
Transposition
Matrix multiplication
Multiplying square matrices for social networks
Outer products
Using sparse matrices in matrix multiplication
Matrix inversion
Solving systems of linear equations
Determinants
Triangular matrices
Matrix decomposition
QR decomposition
Eigenvalue decomposition
Lower upper decomposition
Cholesky decomposition
Singular value decomposition
Applications
Rasch analysis using linear algebra and a paired comparisons matrix
Calculating Cronbach's alpha
Image compression using direct cosine transform
Importing an image into R
The compression technique
Creating the transformation and quantization matrices
Putting the matrices together for image compression
DCT in R
Summary
6. Principal Component Analysis and the Common Factor Model
A primer on correlation and covariance structures
Datasets used in this chapter
Principal component analysis and total variance
Understanding the basics of PCA
How does PCA relate to SVD?
Scaled versus unscaled PCA
PCA for dimension reduction
PCA to summarize wine properties
Choosing the number of principal components to retain
Formative constructs using PCA
Exploratory factor analysis and reflective constructs
Familiarizing yourself with the basic terms
Matrices of interest
Expressing factor analysis in a matrix model
Basic EFA and concepts of covariance algebra
Concepts of EFA estimation
The centroid method
Multiple actors
Direct factor extraction by principal axis factoring
Performing principal axis factoring in R
Other factor extraction methods
Factor rotation
Orthogonal factor rotation methods
Quartimax rotation
Varimax rotation
Oblique rotations
Oblimin rotation
Promax rotation
Factor rotation in R
Advanced EFA with the psych package
Summary
7. Structural Equation Modeling and Confirmatory Factor Analysis
Datasets
Political democracy
Physical functioning dataset
Holzinger-Swineford 1939 dataset
The basic ideas of SEM
Components of an SEM model
Path diagram
Matrix representation of SEM
The reticular action model (RAM)
An example of SEM specification
An example in R
SEM model fitting and estimation methods
Assessing SEM model fit
Using OpenMx and matrix specification of an SEM
Summarizing the OpenMx approach
Explaining an entire example
Specifying the model matrices
Fitting the model
Fitting SEM models using lavaan
The lavaan syntax
Comparing OpenMx to lavaan
Explaining an example in lavaan
Explaining an example in OpenMx
Summary
8. Simulations
Basic sample simulations in R
Pseudorandom numbers
The runif() function
Bernoulli random variables
Binomial random variables
Poisson random variables
Exponential random variables
Monte Carlo simulations
Central limit theorem
Using the mc2d package
One-dimensional Monte Carlo simulation
Two-dimensional Monte Carlo simulation
Additional mc2d functions
The mcprobtree() function
The cornode() function
The mcmodel() function
The evalmcmod() function
Data visualization
Multivariate nodes
Monte Carlo integration
Multiple integration
Other density functions
Rejection sampling
Importance sampling
Simulating physical systems
Summary
9. Optimization
One-dimensional optimization
The golden section search method
The optimize() function
The Newton-Raphson method
The Nelder-Mead simplex method
More optim() features
Linear programming
Integer-restricted opt...

Table of contents