AMS597 Exam 1
R basics
YoushouldsubmityourexamviaemailtoourTA,JesseColton
[email protected]lowing
asthesubjectofyouremail
AMS5972015:Exam#1.ID:XXXXXXXXX.Name:XXXXXX
1. Use the R script to finish the following
AMS597 Exam 1
R basics
You should submit your exam via email to our TA, Mengqiao Wang,
[email protected] by the end of the class. You should use the
following as the subject of your email
AMS597 2016: Exam #1
AMS597 Exam 1
R basics
YoushouldsubmityourexamviaemailtoourTA,YuanZhao<[email protected]>bythe
endoftheclass.Youshouldusethefollowingasthesubjectofyouremail
AMS5972014:Exam#1.ID:XXXXXXXXX.Name:XXXXXX
1. Use the following R script to generate the da
AMS597 Homework 5
SAS procedures
You should submit your homework via email to our TA, Han Yu, <[email protected]>
by 6am, May 1. You should use the following as the subject of your email
AMS597 2012: Homework #5. ID: XXXXXXXXX. Name: XXX XXX
1. The
AMS597 Homework 4
SAS Data
You should submit your homework via email to our TA, Han Yu,
<[email protected]> by 6am, April 10. You should use the following as the
subject of your email
AMS597 2012: Homework #4. ID: XXXXXXXXX. Name: XXX XXX
Exercises
AMS597 Term Project
Instruction:
a. Do not consult with any individual about this examination until after the examination is over. You
are required to only consult books, journals and class notes for help in solving these problems and
you are required to
AMS597 Homework 1
R basics
1.1 Consider the following weights 60, 72, 34, 56, 87, 80, 89, 93, 28, 48, 59. Use the R script to
finish the following questions
(1) Assign all these weights as vector weight.
(2) Compute the mean of weight and of the square of
#1.1
sample(c(1:50),10)
#1.2
sample(c(1,2,3),size=100,replace=T,prob=c(0.2,0.3,0.5)
# This is written in the function form.
rndmn<-function(n)cfw_
x<-NULL
for (i in 1:n)cfw_
if (rbinom(1,1,0.2)cfw_
x[i]<-1
elsecfw_
if(rbinom(1,1,0.3/(0.2+0.5)cfw_
AMS597 Homework 1
R basics
1.1 Consider the following weights 60, 72, 34, 56, 87, 80, 89, 93, 28, 48, 59. Use the R script to
finish the following questions
(1) Assign all these weights as vector weight.
(2) Compute the mean of weight and of the square of
AMS597 Homework 3
Regression
YoushouldsubmityourhomeworkviaemailtoourTA,HanYu,
<[email protected]>by6am,March17.Youshouldusethefollowingasthe
subjectofyouremail
AMS5972012:Homework#3.ID:XXXXXXXXX.Name:XXXXXX
1.1 Use the following dataset to answer t
AMS597 Homework 2
R random variables and t-tests
YoushouldsubmityourhomeworkviaemailtoourTA,HanYu,
<[email protected]>by6am,Feb25.Youshouldusethefollowingasthe
subjectofyouremail
AMS5972012:Homework#2.ID:XXXXXXXXX.Name:XXXXXX
1.1 Generate 10 random
AMS597 Exam 2
R random variables and t-tests
YoushouldsubmityourexamviaemailtoourTA,JesseColton
[email protected]lowing
asthesubjectofyouremail
AMS5972015:Exam#2.ID:XXXXXXXXX.Name:XXXXXX
1.1 (1) Use sample fu
#Q1
#(a)
logret<read.table("http:/www.ams.sunysb.edu/~pfkuan/Teaching/AMS597/Data/d_logret_6stocks.txt",h
eader=T)
attach(logret)
fit1<-lm(Pfizer~Exxon+Citigroup)
fit1$coefficients
#The estimated coefficients for Exxon is 0.287636 and Citigroup is 0.18597
#Q.1.
n=10000
x=runif(n,0,pi/3)
omega.hat=(pi/3-0)*mean(sin(x)
omega.hat
#[1] 0.4944274
integrate(sin,0,pi/3)$value
#[1] 0.5
#the estimate 0.4944274 is very close to the actual value of 0.5
#Q.2.
#part a)
m <- 10000
u <- runif(m, 0, 0.5)
theta <- 0.5 * me
AMS597 Homework 4
SAS Data
You should submit your homework with R codes via email to our TA, Yuan Zhao
< [email protected] > by 6am, April 21. You should use the following as
the subject of your email:
AMS597 2014: Homework #4. ID: XXXXXXXXX. Name:
AMS597 Exam 4
You should submit your exam via email to our TA, Yuan Zhao < [email protected] > five
minutes before the end of the class. You should use the following as the subject of your email
AMS597 2014: Exam #4. ID: XXXXXXXXX. Name: XXX XXX
No
AMS 597: Statistical Computing
Pei Fen Kuan
Pei Fen Kuan
MCMC
Markov Chain Monte Carlo (MCMC) methods
encompass a general framework of methods
introduced by Metropolis et al. and Hastings
for Monte Carlo integration.
Earl
AMS 597: Statistical Computing
Pei Fen Kuan
Pei Fen Kuan
Numerical Methods
Overflow occurs when the result of an
arithmetic operation exceeds the maximum
floating point number that can be represented.
Underflow occurs when
AMS 597: Statistical Computing
Pei Fen Kuan
Pei Fen Kuan
Maximum Likelihood Problems
Maximum likelihood is a method of estimation
of parameters of a distribution.
Suppose that X1, . . . , Xn are random variables
with par
AMS 597: Statistical Computing
Pei Fen Kuan
Pei Fen Kuan
Simple Monte Carlo Integration
Monte Carlo integration is a statistical method
based on random sampling.
If X is a r.v with pdf f(x), then
)
= *)
Thus, to estimat