### Perform a principal component analysis on the dataset

Assignment Help MATLAB Programming
##### Reference no: EM13923478

1. For a domain defined between -5 ≤ x ≤ 5 -5

- 5 ≤ y ≤ 5

0 ≤ t 10

Generate a dataset with variability in space and time following:

f (x, y, t) = f1 (x, y, t) + f2 (x, y, t) + f3 (x, y, t)

where

• Standing wave oscillating in time:

f1(x,y,t) = Sin(0.2Πy) * Cos(0.5Πx) * (1 + Cos(2Πt))

• Trend (increasing magnitude in time) with random component:

f2(x, y, t) = 0.09 * t + ε where ε = N(0, 0.01)

• Spike in space at different times:

-1 ≤ x ≤ 1  and

F3(x, y, t) = 0.8 if       =   -1 ≤ y ≤ 1 and

t = 0.4, 1 2, 2.5, 3, 4 2,5,5.3, 6.2,6.6, 7.5,9

= 0                  Otherwise

This problem is aimed at helping you understand the PCA method using an idealized dataset Since you know the data you are generating it should help you understand the capability of the method.

a. Perform a principal component analysis on the dataset you have generated.

b. What is the total variability in the dataset?

c. What is the percent of the total variability explained by the first three components?

d. How many components should be retained?

e. Plot the spatial representation of each of the PCs you retained.

f. Reconstruct (back transform] your original data after reducing the dimensionality of the data. Plot the scores of each of the PCs you retained

2. Using a precipitation dataset provided to you (angle \ homework\ PIV.txt), perform a PCA analysis and interpret the results. Answer the same questions as in Problem 1 The file P_124 file contains monthly precipitation in U.S. from
• January 1979 - December 2000 (264 months).
• It extends from 140 W to 60 W (33 longitude points or rows) and
• 20 N to 60 N (17 latitude points or columns)
It covers the conterminous -United States. The file is read first by longitude, then by latitude and then by time.

When you are doing the PCA, remove the means for each month.

For example: Jani; - average(Jan(1979 - 2001)), so that the dominant mode will not capture the intra-annual cycle (not very interesting).

Q. 2

In case if it helps, I have converted the original precipitation data (PW.txt) to Locations - by - Time 2D data (PW_Loc_Time.txt) and added the file in the homework folder. You can use this new file to calculate the covariance and the PCAs. The figure below shows the spatial variation of the precipitation for month (T = 20). In general, the data consist of 264 (total number of months) similar spatial variations.

Matlab code for reshaping the file:

% Import data
% data size (known)
rows = 33; cols = 17; locat = rows*cols;
months = 264;
%Reshape my data
PWin = reshape(PW,locat,months);

[X,Y] = meshgrid((l:rows),(1:cols));

% which month do you want to plot?

mnt = 20;
Z = reshape(PWin(:,mnt),rows,cols);

surface(Z,'LineStyle', 'none');

Attachment:- Data.rar

#### Calculate and plot the polynomials

Write a script to calculate and plot the polynomials, and then perform simple arithmetic on them - This question belongs to MATLAB software and discusses about application of

#### Matlab program to calculate the rest of the coefficients

Step One: For the design specifications of your filter, see the excel file for specifications (UDO). You need to demonstrate for the first two iterations( n=0 & n=1), by

A one-dimensional steady-state heat flow, the mathematical formulation of problem - find out the temperature differences at each locations and calculate the temperatures at e

#### What is the purpose of the matlas command window

What is the purpose of the MATLAS Command Window. The Edit Window? The Figure Window. List the different ways that you get help in MATLAB. What is a workspace. How can you det

#### Hvac system modeling

Example: Model a scenario to show how extreme temperatures can impact the cost of energy in (\$) consumption due to continuous air condition system usage. Be free to use hypo

#### Matlab code to solve for temperature and pressure variation

Write down the MATLAB code to solve for temperature and pressure variation throughout the expansion process and to evaluate work and heat produced in processes for variable

#### Cell array named carray that will hold numbers and text

In MATLAB, write a program to create a cell array named CArray that will hold numbers and text. Create a loop that first asks for an 'n' to be entered for a number or an 's'

#### Create a function that will determine the total resistance

Create a function that will determine the total resistance of a number of resistors that are connected in parallel. This function should accept a row vector for input,

### Write a Review 