Fundamentals of Climates HW help (R – Statistics Program)

profilekingofgoddan
Extra_Credit_folder.zip

Extra_Credit_folder/extra_credit_P2.R

# # Enter name here. # #name<-"John Doe" # # Read the AAO principal component amplitude time series. # aao<-read.table("aao_amp_1979-2013.dat") attach(aao) aao_data<-V1 time<-seq(1979,2013,len=length(aao_data)) # # Plot the PDF with normal distribution. # x<-seq(-4,3,0.01) y<-exp(-(x-mean(aao_data))^2/(2*var(aao_data)))/(sd(aao_data)*sqrt(2*pi)) jpeg("extra_credit_plot4.jpg") hist(aao_data,seq(-4,3,0.5),prob=TRUE,main="Probability Density Function of AAO Amplitude",xlab="AAO Amplitude",sub=name,ylim=c(0,0.5)) lines(x,y,col="red",lwd=2) dev.off() # detach()

Extra_Credit_folder/aao_amp_1979-2013.dat

0.208759993 0.356260002 0.899179995 0.677579999 0.723739982 1.70000005 2.41210008 0.545530021 0.629459977 0.159789994 -0.422529995 -0.950720012 -0.447030008 -0.979650021 -1.42439997 -2.06820011 -0.478650004 0.285699993 -1.94389999 -0.996810019 -1.70079994 0.577390015 -2.01290011 -0.356299996 0.230509996 0.0392669998 -0.965529978 -1.46200001 -0.343959987 0.351700008 -0.98585999 -2.11829996 -1.50940001 -0.260340005 0.625569999 1.1164 -0.554440022 0.277229995 1.60350001 1.53139997 0.117870003 0.920140028 -0.414719999 0.779280007 1.58000004 -0.702300012 -0.849179983 -1.93369997 -1.34039998 -1.08070004 0.166339993 0.149360001 -0.437220007 -0.262829989 1.11409998 0.792029977 -0.695969999 1.19350004 0.727419972 0.475470006 -1.09749997 -0.54369998 0.250860006 -0.204160005 -1.23740005 0.426079988 0.889599979 -0.548380017 0.326979995 -0.00940379966 -0.0241410006 -1.4756 -0.794799984 0.215470001 -0.133609995 0.0314819999 -0.0660779998 -0.330689996 1.91369998 0.594770014 1.50730002 0.470770001 1.08469999 1.24030006 0.157820001 -1.58800006 -0.76959002 -0.0866969973 -1.84660006 -0.619419992 0.0891610011 -0.157020003 0.848680019 0.305660009 -0.222479999 0.886250019 -0.95036 -0.707669973 -0.132660002 -0.285620004 0.0386260003 -0.701870024 -1.53129995 1.48520005 -0.798889995 0.455480009 1.06040001 0.272289991 -0.611739993 0.550779998 -0.219040006 -0.0768100023 -0.748600006 -1.05490005 0.57595998 -0.744910002 -0.688530028 -2.31399989 0.401010007 1.07449996 0.618449986 0.848919988 0.632120013 -0.573109984 2.69059992 1.99479997 1.4576 -0.13188 -0.12122 0.135769993 0.571969986 -0.445050001 -0.352090001 1.15069997 0.414180011 -1.8786 -1.80340004 0.0930529982 -1.21510005 0.465730011 1.48160005 0.138950005 -0.358960003 -0.311650008 0.868879974 -0.851660013 0.52234 -0.639400005 -0.538559973 -1.15460002 -1.22019994 0.0355090015 -0.513019979 -0.623210013 -0.804170012 -2.06750011 0.0726130009 -1.62679994 -1.01030004 -0.439339995 -2.03200006 -2.19330001 -0.566169977 -0.349530011 0.434960008 -0.319409996 0.12184 0.243609995 -2.02060008 0.437040001 -0.377600014 0.0872130021 1.25989997 1.21790004 1.95710003 1.08290005 1.06099999 0.748149991 0.323659986 1.02810001 0.722660005 1.15699995 0.693340003 -0.0524550006 -0.152720004 -1.68190002 -0.492229998 1.90989995 -0.947049975 -0.577769995 -0.792569995 0.932739973 1.44850004 0.532899976 -0.154390007 0.648800015 1.39670002 -0.801970005 -3.00970006 -0.696470022 1.17330003 -0.0570299998 0.142879993 1.46969998 0.332069993 -0.524950027 0.543460011 0.115000002 0.983169973 -0.252020001 0.0208940003 -1.50189996 -1.31439996 0.965749979 -1.66690004 -0.0230989996 0.368919998 -0.244240001 0.701049984 -0.457569987 1.02810001 -0.457560003 0.779649973 0.768350005 0.12218 -0.59473002 -1.90460002 -0.835500002 0.412530005 0.38955 0.735920012 1.92729998 -0.0380819999 1.03100002 1.45000005 0.904089987 -0.122409999 0.399529994 0.817179978 1.43519998 0.999109983 0.455879986 0.180450007 0.949440002 1.63900006 -1.32490003 0.315629989 0.0418730006 -0.0120900003 1.65349996 0.90061003 1.78380001 1.27339995 0.619729996 0.133059993 0.232679993 1.12709999 0.117229998 0.0585919991 -0.67355001 -1.85290003 0.34702 -1.53709996 -1.29030001 -0.470939994 -0.264880002 -0.554769993 0.514959991 -0.262180001 0.386139989 -0.928250015 0.910319984 1.16139996 1.27709997 0.995819986 1.47360003 0.746860027 1.33410001 -1.82350004 0.164959997 -2.79850006 -1.11199999 -0.590950012 -0.0993840024 -0.864499986 -2.56399989 -0.923529983 1.30850005 -0.987879992 -0.356900007 -0.187700003 0.224309996 0.384499997 -0.774510026 0.727010012 0.677969992 -0.323080003 -0.0248860009 -0.711650014 -1.32290006 0.807099998 -1.18190002 0.431679994 0.151040003 0.459580004 1.1954 1.47430003 -0.0711499974 0.253589988 -0.0424880013 -0.242200002 -0.972890019 -0.128739998 1.24349999 0.158309996 0.355439991 -0.297320008 -1.42770004 -0.251960009 0.228190005 0.240740001 0.03101 -0.551490009 -1.96780002 0.338889986 -0.211319998 0.500559986 -0.169279993 1.6954 0.437959999 0.925530016 -1.72710001 -0.324140012 0.879230022 0.101279996 0.638429999 -0.0828370005 0.0749410018 -0.570129991 -1.0352 -0.611899972 -1.19799995 -2.63070011 -0.10791 0.0305480007 -0.433670014 -0.983799994 1.92929995 1.20850003 1.14740002 0.587480009 -0.873409986 -0.48980999 1.3484 0.320239991 0.0869499967 1.38559997 1.21490002 0.919700027 1.19379997 0.962570012 0.455830008 0.604589999 0.0291600004 -0.73277998 -0.469949991 -1.2342 -0.685590029 -0.0165030006 0.0847870037 -1.91509998 0.606830001 -0.756889999 -0.775219977 0.108280003 0.377389997 1.02100003 2.07069993 2.42370009 1.51010001 0.401800007 1.33490002 1.51629996 0.205420002 0.0523569994 1.07379997 -0.296220005 -0.870010018 1.26569998 -0.0989689976 -1.38419998 -1.20200002 -1.25 0.388209999 -0.907540023 2.57349992 1.58329999 -0.283089995 0.274769992 0.665600002 0.152759999 -0.197139993 1.25929999 0.488840014 0.562380016 -0.444220006 -1.70089996 -0.763520002 0.0710270032 0.715560019 1.37479997 0.61056 0.359620005 -0.271079987 0.945330024 -1.56089997 -1.65830004 -0.457599998 0.188830003 0.0612609982

Extra_Credit_folder/AnswerSheet_ExtraCredit.pdf

OCEA 90 Fundamentals of Climate Fall 2019

OCEA 90: Extra Credit Answer Sheet Name: Section:

TA: Yang Xiang Henry Houskeeper

Assignment Instructions: 1. Put your name and section at the top of this sheet and check the appropriate TA box. 2. Download the assignment from the class website. Follow all instructions carefully and

execute all R scripts as prescribed. 3. Answer all HW questions in the spaces provided below. (Please note: each answer does not

need to fill the entire space provided. The accuracy of your answer is valued, not its length.) 4. All Figures must be printed out and stapled to the back of this answer sheet. (Please print

figures on as few pages as possible, but ensure that all figures are still readable.) 5. Remember the following requirements:

a. Submit your assignment on this answer sheet b. Submit your assignment on time (10% grade reduction per calendar day late) c. Submit all necessary figures d. Submit all figures with your name printed on them (no credit for the entire

assignment if your name is not on the figures) 6. Also:

a. A hard copy of this answer sheet is required. Electronic copies will not be accepted. b. Do not share answers with your classmates (we follow UCSC procedures in cases of

academic misconduct). 7. You are welcome to attend office hours for any TA (and of course the professor)!

1A(iii).

1B.

OCEA 90 Fundamentals of Climate Fall 2019

1C.

1D(i)

1D(ii)

1E

2i. The probability of the AAO amplitude being at or below -1 is 2ii. The probability of the AAO amplitude being at or below +1 is . Therefore, the probability of the AAO amplitude being greater than -1 and less than or equal to +1 is . 2iii. The probability of the AAO amplitude being above +1 is .

__MACOSX/Extra_Credit_folder/._AnswerSheet_ExtraCredit.pdf

Extra_Credit_folder/extra_credit_P1.R

# # Enter name here. # #name<-"John Doe" # # Read the AAO principal component amplitude time series. # aao<-read.table("aao_amp_1979-2013.dat") attach(aao) aao_data<-V1 time<-seq(1979,2013,len=length(aao_data)) # # Plot time series # jpeg("extra_credit_plot1.jpg") plot(time,aao_data,"l",xlab="Time in years",ylab="AAO Amplitude",main="Time Series of AAO Amplitude",sub=name) dev.off() # # Plot the histogram. # jpeg("extra_credit_plot2.jpg") hist(aao_data,seq(-4,3,0.5),ylim=c(0,100),main="Histogram of AAO Amplitude",xlab="AAO Amplitude",sub=name) dev.off() # # Plot the PDF # jpeg("extra_credit_plot3.jpg") hist(aao_data,seq(-4,3,0.5),ylim=c(0,0.5),prob=TRUE,main="Probability Density Function of AAO Amplitude",xlab="AAO Amplitude",sub=name) dev.off() # detach()

Extra_Credit_folder/AnswerSheet_ExtraCredit.docx

OCEA 90 Fundamentals of Climate Fall 2019

OCEA 90: Extra Credit Answer Sheet

Name:      

Section:      

TA: Yang Xiang |_| Henry Houskeeper |_|

Assignment Instructions:

1. Put your name and section at the top of this sheet and check the appropriate TA box.

2. Download the assignment from the class website. Follow all instructions carefully and execute all R scripts as prescribed.

3. Answer all HW questions in the spaces provided below. (Please note: each answer does not need to fill the entire space provided. The accuracy of your answer is valued, not its length.)

4. All Figures must be printed out and stapled to the back of this answer sheet. (Please print figures on as few pages as possible, but ensure that all figures are still readable.)

5. Remember the following requirements:

a. Submit your assignment on this answer sheet

b. Submit your assignment on time (10% grade reduction per calendar day late)

c. Submit all necessary figures

d. Submit all figures with your name printed on them (no credit for the entire assignment if your name is not on the figures)

6. Also:

a. A hard copy of this answer sheet is required. Electronic copies will not be accepted.

b. Do not share answers with your classmates (we follow UCSC procedures in cases of academic misconduct).

7. You are welcome to attend office hours for any TA (and of course the professor)!

1A(iii).

     

1B.

     

1C.

     

1D(i)

     

1D(ii)

     

1E

     

2i. The probability of the AAO amplitude being at or below -1 is      

2ii. The probability of the AAO amplitude being at or below +1 is      . Therefore, the probability of the AAO amplitude being greater than -1 and less than or equal to +1 is      .

2iii. The probability of the AAO amplitude being above +1 is      .

__MACOSX/Extra_Credit_folder/._AnswerSheet_ExtraCredit.docx

Extra_Credit_folder/extra_credit_canvas.pdf

1

Extra Credit Assignment

DUE DATE: Friday, 6 December, in class – NO EXCEPTIONS

Download the following files onto your computer which you will find on canvas on the “Extra Credit Assignment” page:

extra_credit_P1.R

extra_credit_P2.R

extra_credit_P3.R

aao_amp_1979-2013.dat

Next, start up “R” and at the prompt (>>) enter your name in the following way:

name<-“Jane Doe”

Important: Be sure to do this before you run each new program.

This step is very important since it will identify you on the results of your work. If your name does not appear appropriately on the graphical output that you hand-in with your completed assignments, you will receive no credit for this assignment. In addition, if you omit this step, the R-programs for this exercise will not work correctly and you will get an error message.

PLEASE HAND IN ALL OF THE FIGURES GENERATED BY THE PROGRAMS THAT YOU RUN FOR THIS ASSIGNMENT.

The Antarctic Oscillation (AAO)

As we discussed in class, principal component analysis of the 750mb geopotential height over the entire southern hemisphere reveals the existence of an annular mode of variability called the Antarctic Oscillation (the AAO; also sometimes referred to as the Southern Annular Mode (SAM)) . Figure 1 shows the pattern of 750mb geopotential height anomalies associated with the AAO which recall is the first principal component.

2

Question 1:

Figure 1: The 750mb geopotential height associated with the positive phase of the AAO.

(a) Run the program “extra_credit_P1.R” in R. This will load the data for the principal component time series of the monthly mean 750mb geopotential height anomalies associated with the Antarctic Oscillation (AAO) for the period 1979-2013, and will generate three figures: extra_credit_plot1.jpg - a plot of the time series of the AAO principal component time series (i.e. the amplitude of the pattern shown in Fig. 1); extra_credit_plot2.jpg – a histogram of the AAO amplitude; extra_credit_plot3.jpg –the probability density function (PDF) of the AAO amplitude. The time series of AAO amplitude is called “aao_data.” (i) First compute the mean AAO amplitude for the entire 35 year period, and record the value that you obtain on plot3. (ii) Next, estimate the mode of the probability density function using either plot2 or plot3, and record this number on plot3. (iii) Briefly explain how the mean is computed, and the definition of the mode, and compare the two numbers computed here.

(b) Compute the standard deviation of the AAO amplitude, and record this number on plot3. Explain what is meant by the standard deviation.

3

(c) Now run the program extra_credit_P2.R. This will generate a new figure called extra_credit_plot4.jpg which is the same as plot3 except a normal distribution with the same mean and standard deviation as the AAO amplitude time series is superimposed on the PDF. Briefly describe how well the PDF of the AAO amplitude is described by a normal distribution.

(d) Now run extra_credit_P3.R which yields an additional figure called extra_credit_plot5.jpg which shows the cumulative probability distribution for the AAO amplitude. (i) In your own words, explain what a cumulative probability density function shows. (ii) Using plot5, estimate the median of the distribution and explain clearly how you did this. Record this number on plot3 and compare to the mean and the mode from part (a).

(e) If the PDF of the AAO amplitude was described by a normal distribution, what can you say about the mean, the mode and the median of the amplitude?

Question 2:

Consider the following scenario. A group of researchers at the NOAA Aeronomy Laboratory in Boulder, Colorado, is trying to establish whether a relationship exists between the amplitude of the AAO and the rate of stratospheric ozone depletion that occurs each year over the Antarctic continent. They have asked you to provide them with the following probabilities: (i) The probability that the AAO amplitude will be less than or equal to -1; (ii) The probability that the AAO amplitude will be greater than -1 and less than or equal to +1; (iii) The probability that the AAO amplitude will be greater than +1. Estimate these three probabilities using information from question 1, and record them on plot5.

__MACOSX/Extra_Credit_folder/._extra_credit_canvas.pdf

Extra_Credit_folder/extra_credit_P3.R

# # Enter name here. # #name<-"John Doe" # # Read the AAO principal component amplitude time series. # aao<-read.table("aao_amp_1979-2013.dat") attach(aao) aao_data<-V1 time<-seq(1979,2013,len=length(aao_data)) # # Plot the Cumulative Probability Distribution. # jpeg("extra_credit_plot5.jpg") plot(ecdf(aao_data),xlab="AAO Amplitude",ylab="c(T)",main="Cumulative Probability Function: AAO Amplitude",sub=name,do.points=FALSE,verticals=TRUE) dev.off() detach()