You are on page 1of 2

Matrix

rm = apply(B; 1; mean) , 1: matrix 1 indicates rows, 2 indicates columns, c(1,


2) indicates rows and columns

Given a matrix A in R, write a program that subtracts each column of A by


the column’s mean value to get a matrix with all column sums equal to
zero.
➢ t(t(A)-apply(A,2,mean))
Type I Error: P(H0 is rejected | H0 ) , Type II Error: P(H0 is not rejected | H1 )

x=matrix(c(33,200712,115,201114),nc=2,
dimnames=list(c("real","fake"),c("polio","no polio")))

Chapter 3: Securities Market


Generate 1000 random values from the standard normal distribution:
x = rnorm(1000)

*2
represents that the regression model can explain only around 20% of the
variation in the response Wind.

If Wind and Temp were reversed in the regression, then the R2 would keep
the same because in this simple linear regression model R2 is just the
square of the correlation coefficient between Wind and Temp.

Graph Accept Reject


par(mfrow=c(2,1))
plot(B[gender=="M"],A[gender=="M"], main="header",
ylab="A",xlab="B",xlim=c(0,100), ylim=c(80,130))

Skew,kurtosis,trimmed,winsorized
#function for computing skewness
skew=function(x) {n=length(x)
m2=sum((x-mean(x))^2)/n
m3=sum((x-mean(x))^3)/n
m3/m2^(3/2)*sqrt(n*(n-1))/(n-2) }
skew(wip1)
skew(wip2)
#kurtosis#
kurt=function(x) {
n=length(x)
m4=sum((x-mean(x))^4)/n
m2=sum((x-mean(x))^2)/n
(n-1)/((n-2)*(n-3))*((n+1)*m4/m2^2-3*(n-1)) }
kurt(wip1) z-test and ANOVA

mean(days, trim=0.2)

Distribution

Solution

double exponential cauchy

weibull

CI and Hypothesis testing Simulation


1/M = probability of acceptance

Chapter 8: The Efficient Market Hypotheisis

Chapter 8: The Efficient Market Hypotheisis

the

You might also like