#this post is created as a solution for assignment for IT &
Business Applications Lab, Spring Semester, VGSoM, IIT Kharagpur Class
of 2014.
As our learning progressed, we explored some more features of R(Matrix Representation,Regression Analysis, Normal Distribution).
Based on our learning, we are submitting the following asignments:
Assignment # 2
We have to Multiply 2 matrices
Sol -:
Command to multiply 2 matrices
> multip <- z1 %*% z2
Assignment #3-:
1.To download NSE data dated from 1st Dec, 2012 to 31st Dec, 2012 in the form of a .csv file.
2.To find regression between the High Price and the opening share price and calculate the residuals. Soln- :
Command for finding the Regression :
> reg1<-lm(HighPrice ~ OpenPrice , data = NSEData)
The above arguments are explained below:
NSEData - Object with file historical data
High Price - Dependent variable
Open Price - Independent variable
The snapshot of the data collected is given below:
The Residuals calculated are given below:
Assignment # 4
We have to Generate and plot a Normal distribution, with arbitrary mean and standard deviation taken.Soln -:
To generate normally distributed random numbers function used is -:
dnorm(N, mean,sd)
where N is the no of observations
mean is the mean vector
sd - standard deviation
The command ran are given below:
We have got the following normal distribution curve for the taken mean and standard deviation:
As our learning progressed, we explored some more features of R(Matrix Representation,Regression Analysis, Normal Distribution).
Based on our learning, we are submitting the following asignments:
Assignment # 1
a. We have to create two matrix.
b. We have to select
highlighted columns.
c. We have to use "cbind" command to join those two columns and create a new matrix.
The solution is given below:
Sol -:
Matrix 2 assignment and generation
> mat1<-c(1:10)
> dim(mat1)<-c(2,5)
Matrix 2 assignment and generation
> mat2<-c(11:16)
> dim(mat2)<-c(2,3)
Taking 3rd column from matrix1 and 2nd column from matrix 2, we use the cbind(for column binding) and rbind(for row binding) functions as shown -
> mat1<-c(1:10)
> dim(mat1)<-c(2,5)
Matrix 2 assignment and generation
> mat2<-c(11:16)
> dim(mat2)<-c(2,3)
Taking 3rd column from matrix1 and 2nd column from matrix 2, we use the cbind(for column binding) and rbind(for row binding) functions as shown -
Assignment # 2
We have to Multiply 2 matrices
Sol -:
Command to multiply 2 matrices
> multip <- z1 %*% z2
Assignment #3-:
1.To download NSE data dated from 1st Dec, 2012 to 31st Dec, 2012 in the form of a .csv file.
2.To find regression between the High Price and the opening share price and calculate the residuals. Soln- :
Command for finding the Regression :
> reg1<-lm(HighPrice ~ OpenPrice , data = NSEData)
The above arguments are explained below:
NSEData - Object with file historical data
High Price - Dependent variable
Open Price - Independent variable
The snapshot of the data collected is given below:
The Residuals calculated are given below:
Assignment # 4
We have to Generate and plot a Normal distribution, with arbitrary mean and standard deviation taken.Soln -:
To generate normally distributed random numbers function used is -:
dnorm(N, mean,sd)
where N is the no of observations
mean is the mean vector
sd - standard deviation
The command ran are given below:
We have got the following normal distribution curve for the taken mean and standard deviation:






No comments:
Post a Comment