Contents 1 Installing Required Packages 2 2 Background 2 2.1 Principal Component Analysis (PCA) . . . . . . . . . . . . . . XXXXXXXXXX2 2.2 Modified STL File Structure . . . . . . . . . . . . . . . ....



I have a project in Matlab that I have to complete. I have attached a pdf file that explains the project. Make sure to follow all instructions including writing the code and writing a report explaining the codes in detail! PLEASE ONLY ACCEPT THIS IF YOU ARE CERTAIN YOU CAN SOLVE IT CORRECTLY!




Contents 1 Installing Required Packages 2 2 Background 2 2.1 Principal Component Analysis (PCA) . . . . . . . . . . . . . . . . . . . . . . . . 2 2.2 Modified STL File Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 2.3 Spatial S.I.R. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.4 ODE solver - Runge-Kutta methods . . . . . . . . . . . . . . . . . . . . . . . . . 6 2.5 Plots and animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 3 Problem Statement 8 3.1 Main Component Analysis with PCA . . . . . . . . . . . . . . . . . . . . . . . . 8 3.1.1 Implementing the PCA Algorithm . . . . . . . . . . . . . . . . . . . . . . 8 3.1.2 Problem 1 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.2 Solving the Spatial S.I.R. Model . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2.1 Importing the Mesh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 3.2.2 Implementing the Runge-Kutta Algorithm . . . . . . . . . . . . . . . . . . 9 3.2.3 Implementing the Dynamics Model . . . . . . . . . . . . . . . . . . . . . 9 3.2.4 Solving the Dynamics Model . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2.5 Time Series Plotting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 3.2.6 3D Animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.2.7 Write data to Excel spreadsheets . . . . . . . . . . . . . . . . . . . . . . . 13 3.2.8 Problem 2 Main Script . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 4 pcode Functions 15 5 Project Deliverables 16 5.1 Code (70%) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 5.2 Report (30%) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 1 1 Installing Required Packages The Statistical and Machine Learning and Computer Vision Toolbox packages are needed for this project. Detailed instructions for package installation can be found here: https://www.mathworks.com/matlabcentral/answers/101885-how-do-i- install-additional-toolboxes-into-an-existing-installation-of- matlab#answer_361463. 2 Background 2.1 Principal Component Analysis (PCA) The emergence of the era of big data has accelerated the machine learning revolution. However, when data is highly dimensional, we are faced with the curse of dimensionality. This refers to the fact that the time taken to solve problems increases exponentially with the dimension. As a result, this creates problems that did not exist for low dimensional data. As the number of features (similar to variables) increases, the model becomes more complex. The greater the number of features, the higher the chance of overfitting, which occurs when a model learns the training data so well that it loses its generality. Hence, avoiding overfitting is a major motivation for dimensionality reduction. There are multiple popular dimensionality reduc- tion techniques, such as singular value decomposition (SVD), principal component analysis (PCA), factor analysis (FA) and independent component analysis (ICA). Principal component analysis is widely used now in machine learning as unsupervised learning in the field of chemometrics and multivariate analysis. A sample application of PCA in MATLAB is available here: https://www.mathworks.com/help/stats/quality-of-life-in-u-s- cities.html To demonstrate the effectiveness of PCA for analyzing a dataset, we will be considering the COVID-19 data from 27 different countries, provided in the covid countries.csv file. In the file, you are given six dimensional data (infections, deaths, cures, morality rate, cure rate, and infection rate). The objective of PCA here is to reduce the dimensionality of the data by identifying the components of the data that are most relevant, and representing the data in the corresponding axes, i.e. the principle components. You are encouraged to learn more about the theory behind PCA as it is a widely used tool in modern data analysis. Here is one of the refer- ences: http://www.stat.cmu.edu/˜cshalizi/uADA/12/lectures/ch18.pdf. The data in the .csv file can be parsed by many functions, such as readtable, readmatrix, csvimport, csvread, textscan. Some of these functions also extract the column titles, which may be more useful as you can easily identify the data. The main steps in the PCA algorithm are: 1. Data standardization: Data standardization/feature scaling is a common preprocessing technique in machine learn- ing where the values are centered around the mean with a unit standard deviation. This means that the averages of the features become zero and the resultant distribution has a 2 https://www.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-matlab#answer_361463 https://www.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-matlab#answer_361463 https://www.mathworks.com/matlabcentral/answers/101885-how-do-i-install-additional-toolboxes-into-an-existing-installation-of-matlab#answer_361463 https://www.mathworks.com/help/stats/quality-of-life-in-u-s-cities.html https://www.mathworks.com/help/stats/quality-of-life-in-u-s-cities.html http://www.stat.cmu.edu/~cshalizi/uADA/12/lectures/ch18.pdf unit standard deviation. The data is represented as a n × p matrix where the columns correspond to variables and rows are the observations. To center the data, for each col- umn in the data, first compute and subtract the average of column from each element of the column and then divide each element of the column by the standard deviation of col- umn. The average/mean and standard deviation of an array/matrix defined here: https: //www.mathworks.com/help/matlab/ref/std.html. Do NOT use functions mean and std in MATLAB. 2. Covariance Matrix Computation: Covariance matrices are very useful as they provide an estimate of the variance in individual features while simultaneously determining their correlation. The square covariance matrix C ∈ Rp×p can be computed by following its mathematical definition. The covariance matrix C of matrix M is C(M) = MT ∗M m− 1 , (1) where m is the number of rows of M . Please do NOT directly use the cov function in MATLAB. 3. Eigenvalues/Eigenvectors Calculation: From the covariance matrix C, compute its eigenvalues and corresponding eigenvectors. Lookup MATLAB ’s eig function to learn how this can be done. Eigenvectors make under- standing linear transformations easy. They are the ”axes” (directions) along which a linear transformation acts simply by ”stretching/compressing” and/or ”flipping”; eigenvalues pro- vide the factors by which this stretching occurs. 4. Principal Components Extraction: By sorting the absolute values of the eigenvalues from greatest to smallest, we can determine the most important components of the data. The directions of these components (interpreted
Nov 20, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here