Tuesday, January 15, 2013

Business App IT Lab - Session 2


Assignment 1

To bind columns/rows from 2 different matrices into a new matrix


Solution

As indicated in the screenshot below


Assignment 2

Multiply two matrices

Solution

As indicated in the below screenshot


Assignment 3

To read NSE historical data dated from 1st Dec, 2012 to 31st Dec, 2012 from a .csv file.
To find regression between the High Price and the opening share price and also calculating the 
residuals.

Solution

Commands as indicated in the below screenshot


Residuals


 Plot

Assignment 4

To generate data for a normal distribution and plot the distribution curve

Solution

To generate normally distributed random numbers function used is -:

rnorm(N, mean,sd)
where N is the no of observations
mean is the mean vector
sd - standard deviation

As shown below


Plot is as follows

> plot(values,pden)




No comments:

Post a Comment