GENERALIZED ERROR DISTRIBUTION

Size: px
Start display at page:

Download "GENERALIZED ERROR DISTRIBUTION"

Transcription

1 CHAPTER 21 GENERALIZED ERROR DISTRIBUTION 21.1 ASSIGNMENT Write R functions for the Generalized Error Distribution, GED. Nelson [1991] introduced the Generalized Error Distribution for modeling GARCH time series processes. The GED has exponentially stretched tails. The GED includes the normal distribution as a special case, along with many other distributions. Some are more fat tailed than the normal, for example the double exponential, and others are more thin-tailed like the uniform distribution. Write R functions to compute density, probabilities and quantiles for the GED. Write an R function to generate random variates. Write an R function to estimate the parameters for a GED using the maximum log-likelihood approach. References Daniel B. Nelson, 1991, Conditional Heteroskedasticity in Asset : A New Approach Econometrica 59, Wikipedia, Generalized Normal Distribution, 2010, R IMPLEMENTATION The density of the standardized GED is described by the following formula f (x )= νexp[ 1 z 2 /λν ] λ2 (1+1/ν) Γ(1/ν) where Γ() is the gamma function, and (21.1) 213

2 214 GENERALIZED ERROR DISTRIBUTION λ [2 2/ν Γ(1/ν)/Γ(3/ν)] 1/2 (21.2) ν is a tail-thickness parameter. When ν = 2, x has a standard normal distribution. For ν<2, the distribution of x has thicker tails than the normal. For example when ν = 1, x has a double exponential distribution. For ν>2, the distribution has thinner tails than the normal, for ν =, x is uniformly distributed on the interval [ 3, 3]. GED density function Write an R function to compute the density for the GED > dged <- function(x, mean = 0, sd = 1, nu = 2) { z = (x - mean)/sd lambda = sqrt(2^(-2/nu) * gamma(1/nu)/gamma(3/nu)) g = nu/(lambda * (2^(1 + 1/nu)) * gamma(1/nu)) density = g * exp(-0.5 * (abs(z/lambda))^nu)/sd density GED probability function Write an R function to compute the probability function for the GED. > pged <- function(q, mean = 0, sd = 1, nu = 2) { q = (q - mean)/sd lambda = sqrt(2^(-2/nu) * gamma(1/nu)/gamma(3/nu)) g = nu/(lambda * (2^(1 + 1/nu)) * gamma(1/nu)) h = 2^(1/nu) * lambda * g * gamma(1/nu)/nu s = 0.5 * (abs(q)/lambda)^nu probability = sign(q) * h * pgamma(s, 1/nu) probability GED quantile function Write an R function to compute the quantile function for the GED. > qged <- function(p, mean = 0, sd = 1, nu = 2) { lambda = sqrt(2^(-2/nu) * gamma(1/nu)/gamma(3/nu)) q = lambda * (2 * qgamma((abs(2 * p - 1)), 1/nu))^(1/nu) quantiles = q * sign(2 * p - 1) * sd + mean quantiles GED random number generation Write an R function to generate random variates from the GED.

3 21.3. EXAMPLES 215 > rged <- function(n, mean = 0, sd = 1, nu = 2) { lambda = sqrt(2^(-2/nu) * gamma(1/nu)/gamma(3/nu)) r = rgamma(n, 1/nu) z = lambda * (2 * r)^(1/nu) * sign(runif(n) - 1/2) rvs = z * sd + mean rvs GED parameter estimation Write an R function to estimate the parameters from empirical return series data for a GED using the maximum log-likelihood approach. > gedfit <- function(x,...) { start = c(mean = mean(x), sd = sqrt(var(x)), nu = 2) loglik = function(x, y = x) { f = -sum(log(dged(y, x[1], x[2], x[3]))) f fit = nlminb(start = start, objective = loglik, lower = c(-inf, 0, 0), upper = c(inf, Inf, Inf), y = x,...) names(fit$par) = c("mean", "sd", "nu") fit 21.3 EXAMPLES Plot GED density Compute and display the GED with zero mean and unit variance in the range (-4,4) for three different parameter settings of ν,1,2,and3. > x = seq(-4, 4, length = 501) > y = dged(x, mean = 0, sd = 1, nu = 1) > plot(x, y, type = "l",, col = "blue", main = "GED", ylab = "", xlab = "") > y = dged(x, mean = 0, sd = 1, nu = 2) > lines(x, y, col = "red") > y = dged(x, mean = 0, sd = 1, nu = 3) > lines(x, y, col = "green") > abline(h = 0, col = "grey") Normalization of the GED density Show for a random parameter setting of the mean and standard deviation that the GED density is normalized. > set.seed(4711) > MEAN = rnorm(1) > SD = runif(1) > for (NU in 1:3) print(integrate(dged, -Inf, Inf, mean = MEAN,

4 216 GENERALIZED ERROR DISTRIBUTION GED FIGURE 21.1: GED Plots for nu=c(1, 2, 3) sd = SD, nu = NU)) 1 with absolute error < with absolute error < 5.5e-07 1 with absolute error < 5.6e-05 Repeat this computation for other settings of MEAN and SD. Check the pged and qged functions To check these functions, here for zero mean and unit standard deviation, we compute the quantiles from the probabilities of quantiles. > q = c(0.001, 0.01, 0.1, 0.5, 0.9, 0.99, 0.999) > q [1] > p = pged(q) > p [1]

5 21.3. EXAMPLES 217 > qged(p) [1] LPP histogram plot We want to test the three Swiss Pension Fund Indices if they are normal distributed. These are Pictet s so calle LPP indices named LPP25, LPP40, and LPP60. The numbers reflect the amount of equities included, thus the indices reflect benchmarks with increasing risk levels. The data set is downloadable from the r-forge web site as a semicolon separated csv file. The file has 10 columns, the first holds the dates, the next 6 index data of bond, reit and stock indices, and the last tree the Swiss pension fund index benchmarks. Download the data and select columns 2 to 4 > library(fecofin) > data(swxlp) > LPP.INDEX <- SWXLP[, 5:7] > head(lpp.index) LP25 LP40 LP Compute daily percentual returns > LPP = 100 * diff(log(as.matrix(lpp.index))) Create a nice histogram plot which adds a normal distribution fit to the histogram, adds the mean as a vertical Line, and adds rugs to the x-axis. Use nice colors to display the histogram. > histplot <- function(x,...) { X = as.vector(x) H = hist(x = X,...) box() grid() abline(h = 0, col = "grey") mean = mean(x) sd = sd(x) xlim = range(h$breaks) s = seq(xlim[1], xlim[2], length = 201) lines(s, dnorm(s, mean, sd), lwd = 2, col = "brown") abline(v = mean, lwd = 2, col = "orange") Text = paste("mean:", signif(mean, 3)) mtext(text, side = 4, adj = 0, col = "darkgrey", cex = 0.7) rug(x, ticksize = 0.01, quiet = TRUE) invisible(s)

6 218 GENERALIZED ERROR DISTRIBUTION LP25 LP40 Mean: Mean: LP60 Mean: FIGURE 21.2: Histogram Plots for the LPP Benchmark Indices Plot the three histograms > par(mfrow = c(2, 2)) > main = colnames(lpp) > for (i in 1:3) histplot(lpp[, i], main = main[i], col = "steelblue", border = "white", nclass = 25, freq = FALSE, xlab = "") Parameter estimation Fit the parameters to a GED for the three LPP benchmark series > param = NULL > for (i in 1:3) param = rbind(param, gedfit(lpp[, i])$par) > rownames(param) = colnames(lpp) > param mean sd nu LP LP LP

7 21.4. EXERCISES 219 LP25 LP40 Mean: Mean: LP60 Mean: FIGURE 21.3: LPP Histogram Plots with fitted Normal (brown) and GED (green). Note that all three histogram plots are on the same scale. Overlay the histograms with a fitted GED > par(mfrow = c(2, 2)) > main = colnames(lpp) > for (i in 1:3) { u = histplot(lpp[, i], main = main[i], col = "steelblue", border = "white", nclass = 25, freq = FALSE, xlab = "") v = dged(u, mean = param[i, 1], sd = param[i, 2], nu = param[i, 3]) lines(u, v, col = "darkgreen", lwd = 2) 21.4 EXERCISES Rewrite the functions dged() as in the case of dnorm() > args(dnorm)

8 220 GENERALIZED ERROR DISTRIBUTION function (x, mean = 0, sd = 1, log = FALSE) NULL with an additional argument of log. Use this function for the estimation of the distributional parameters in the function gedfit(). Rewrite the functions pged() and qged() as in the case of pnorm() and qnorm() > args(pnorm) function (q, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) NULL > args(qnorm) function (p, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE) NULL with additional arguments of lower.tail and log.p. The arguments log and log.p are logical values, if TRUE probabilities p are given as log(p). lower.tail is a logical value; if TRUE, probabilities are P[X x ], otherwise, P[X > x ].

Explore the data. Anja Bråthen Kristoffersen Biomedical Research Group

Explore the data. Anja Bråthen Kristoffersen Biomedical Research Group Explore the data Anja Bråthen Kristoffersen Biomedical Research Group density 0.2 0.4 0.6 0.8 Probability distributions Can be either discrete or continuous (uniform, bernoulli, normal, etc) Defined by

More information

Class 04 - Statistical Inference

Class 04 - Statistical Inference Class 4 - Statistical Inference Question 1: 1. What parameters control the shape of the normal distribution? Make some histograms of different normal distributions, in each, alter the parameter values

More information

Explore the data. Anja Bråthen Kristoffersen

Explore the data. Anja Bråthen Kristoffersen Explore the data Anja Bråthen Kristoffersen density 0.2 0.4 0.6 0.8 Probability distributions Can be either discrete or continuous (uniform, bernoulli, normal, etc) Defined by a density function, p(x)

More information

Matematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer

Matematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer Lunds universitet Matematikcentrum Matematisk statistik Matematisk statistik allmän kurs, MASA01:A, HT-15 Laborationer General information on labs During the rst half of the course MASA01 we will have

More information

f Simulation Example: Simulating p-values of Two Sample Variance Test. Name: Example June 26, 2011 Math Treibergs

f Simulation Example: Simulating p-values of Two Sample Variance Test. Name: Example June 26, 2011 Math Treibergs Math 3070 1. Treibergs f Simulation Example: Simulating p-values of Two Sample Variance Test. Name: Example June 26, 2011 The t-test is fairly robust with regard to actual distribution of data. But the

More information

Statistical Computing Session 4: Random Simulation

Statistical Computing Session 4: Random Simulation Statistical Computing Session 4: Random Simulation Paul Eilers & Dimitris Rizopoulos Department of Biostatistics, Erasmus University Medical Center p.eilers@erasmusmc.nl Masters Track Statistical Sciences,

More information

Package bpp. December 13, 2016

Package bpp. December 13, 2016 Type Package Package bpp December 13, 2016 Title Computations Around Bayesian Predictive Power Version 1.0.0 Date 2016-12-13 Author Kaspar Rufibach, Paul Jordan, Markus Abt Maintainer Kaspar Rufibach Depends

More information

Ch 7 : One-Sample Test of Hypothesis

Ch 7 : One-Sample Test of Hypothesis Summer 2017 UAkron Dept. of Stats [3470 : 461/561] Applied Statistics Ch 7 : One-Sample Test of Hypothesis Contents 1 Preliminaries 3 1.1 Test of Hypothesis...............................................................

More information

Package esaddle. R topics documented: January 9, 2017

Package esaddle. R topics documented: January 9, 2017 Package esaddle January 9, 2017 Type Package Title Extended Empirical Saddlepoint Density Approximation Version 0.0.3 Date 2017-01-07 Author Matteo Fasiolo and Simon Wood Maintainer Matteo Fasiolo

More information

Package skellam. R topics documented: December 15, Version Date

Package skellam. R topics documented: December 15, Version Date Version 0.2.0 Date 2016-12-13 Package skellam December 15, 2016 Title Densities and Sampling for the Skellam Distribution Author Jerry W. Lewis, Patrick E. Brown , Michail Tsagris

More information

Package emg. R topics documented: May 17, 2018

Package emg. R topics documented: May 17, 2018 Package emg May 17, 2018 Type Package Title Exponentially Modified Gaussian (EMG) Distribution Version 1.0.7 Date 2018-05-17 Author Shawn Garbett, Mark Kozdoba Maintainer Shawn Garbett

More information

1 Probability Distributions

1 Probability Distributions 1 Probability Distributions A probability distribution describes how the values of a random variable are distributed. For example, the collection of all possible outcomes of a sequence of coin tossing

More information

Holiday Assignment PS 531

Holiday Assignment PS 531 Holiday Assignment PS 531 Prof: Jake Bowers TA: Paul Testa January 27, 2014 Overview Below is a brief assignment for you to complete over the break. It should serve as refresher, covering some of the basic

More information

MALA versus Random Walk Metropolis Dootika Vats June 4, 2017

MALA versus Random Walk Metropolis Dootika Vats June 4, 2017 MALA versus Random Walk Metropolis Dootika Vats June 4, 2017 Introduction My research thus far has predominantly been on output analysis for Markov chain Monte Carlo. The examples on which I have implemented

More information

First steps of multivariate data analysis

First steps of multivariate data analysis First steps of multivariate data analysis November 28, 2016 Let s Have Some Coffee We reproduce the coffee example from Carmona, page 60 ff. This vignette is the first excursion away from univariate data.

More information

Handout 4: Simple Linear Regression

Handout 4: Simple Linear Regression Handout 4: Simple Linear Regression By: Brandon Berman The following problem comes from Kokoska s Introductory Statistics: A Problem-Solving Approach. The data can be read in to R using the following code:

More information

Metric Predicted Variable on One Group

Metric Predicted Variable on One Group Metric Predicted Variable on One Group Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Prior Homework

More information

Outline. Unit 3: Inferential Statistics for Continuous Data. Outline. Inferential statistics for continuous data. Inferential statistics Preliminaries

Outline. Unit 3: Inferential Statistics for Continuous Data. Outline. Inferential statistics for continuous data. Inferential statistics Preliminaries Unit 3: Inferential Statistics for Continuous Data Statistics for Linguists with R A SIGIL Course Designed by Marco Baroni 1 and Stefan Evert 1 Center for Mind/Brain Sciences (CIMeC) University of Trento,

More information

Introductory Statistics with R: Simple Inferences for continuous data

Introductory Statistics with R: Simple Inferences for continuous data Introductory Statistics with R: Simple Inferences for continuous data Statistical Packages STAT 1301 / 2300, Fall 2014 Sungkyu Jung Department of Statistics University of Pittsburgh E-mail: sungkyu@pitt.edu

More information

Understanding p Values

Understanding p Values Understanding p Values James H. Steiger Vanderbilt University James H. Steiger Vanderbilt University Understanding p Values 1 / 29 Introduction Introduction In this module, we introduce the notion of a

More information

GOV 2001/ 1002/ E-2001 Section 3 Theories of Inference

GOV 2001/ 1002/ E-2001 Section 3 Theories of Inference GOV 2001/ 1002/ E-2001 Section 3 Theories of Inference Solé Prillaman Harvard University February 11, 2015 1 / 48 LOGISTICS Reading Assignment- Unifying Political Methodology chs 2 and 4. Problem Set 3-

More information

Math493 - Fall HW 4 Solutions

Math493 - Fall HW 4 Solutions Math493 - Fall 2017 - HW 4 Solutions Renato Feres - Wash. U. Preliminaries We have up to this point ignored a central aspect of the Monte Carlo method: How to estimate errors? Clearly, the larger the sample

More information

ST417 Introduction to Bayesian Modelling. Conjugate Modelling (Poisson-Gamma)

ST417 Introduction to Bayesian Modelling. Conjugate Modelling (Poisson-Gamma) ST417 Introduction to Bayesian Modelling Conjugate Modelling (Poisson-Gamma) Slides based on the source provided courtesy of Prof. D.Draper, UCSC ST417 Intro to Bayesian Modelling 1 Integer-Valued Outcomes

More information

Package invgamma. May 7, 2017

Package invgamma. May 7, 2017 Package invgamma May 7, 2017 Type Package Title The Inverse Gamma Distribution Version 1.1 URL https://github.com/dkahle/invgamma BugReports https://github.com/dkahle/invgamma/issues Description Light

More information

Solving partial differential equations, using R package ReacTran

Solving partial differential equations, using R package ReacTran Solving partial differential equations, using R package ReacTran Karline Soetaert and Filip Meysman Centre for Estuarine and Marine Ecology Netherlands Institute of Ecology The Netherlands Abstract R -package

More information

Package jmuoutlier. February 17, 2017

Package jmuoutlier. February 17, 2017 Type Package Package jmuoutlier February 17, 2017 Title Permutation Tests for Nonparametric Statistics Version 1.3 Date 2017-02-17 Author Steven T. Garren [aut, cre] Maintainer Steven T. Garren

More information

Statistical Thinking and Data Analysis Computer Exercises 2 Due November 10, 2011

Statistical Thinking and Data Analysis Computer Exercises 2 Due November 10, 2011 15.075 Statistical Thinking and Data Analysis Computer Exercises 2 Due November 10, 2011 Instructions: Please solve the following exercises using MATLAB. One simple way to present your solutions is to

More information

Package leiv. R topics documented: February 20, Version Type Package

Package leiv. R topics documented: February 20, Version Type Package Version 2.0-7 Type Package Package leiv February 20, 2015 Title Bivariate Linear Errors-In-Variables Estimation Date 2015-01-11 Maintainer David Leonard Depends R (>= 2.9.0)

More information

Chapter 3 - The Normal (or Gaussian) Distribution Read sections

Chapter 3 - The Normal (or Gaussian) Distribution Read sections Chapter 3 - The Normal (or Gaussian) Distribution Read sections 3.1-3.2 Basic facts (3.1) The normal distribution gives the distribution for a continuous variable X on the interval (-, ). The notation

More information

Biostatistics Xinhai Li Probability distribution

Biostatistics Xinhai Li Probability distribution Probability distribution 1 Table of content Probability theory Some distributions Binomial distribution Poisson distribution Negative binomial distribution Uniform distribution Normal distribution Chi-square

More information

Transformations of Standard Uniform Distributions

Transformations of Standard Uniform Distributions Transformations of Standard Uniform Distributions We have seen that the R function runif uses a random number generator to simulate a sample from the standard uniform distribution UNIF(0, 1). All of our

More information

Package FDRSeg. September 20, 2017

Package FDRSeg. September 20, 2017 Type Package Package FDRSeg September 20, 2017 Title FDR-Control in Multiscale Change-Point Segmentation Version 1.0-3 Date 2017-09-20 Author Housen Li [aut], Hannes Sieling [aut], Timo Aspelmeier [cre]

More information

Time Series Models for Measuring Market Risk

Time Series Models for Measuring Market Risk Time Series Models for Measuring Market Risk José Miguel Hernández Lobato Universidad Autónoma de Madrid, Computer Science Department June 28, 2007 1/ 32 Outline 1 Introduction 2 Competitive and collaborative

More information

Homework 6 Solutions

Homework 6 Solutions Homework 6 Solutions set.seed(1) library(mvtnorm) samp.theta

More information

Lab 9: An Introduction to Wavelets

Lab 9: An Introduction to Wavelets Lab 9: An Introduction to Wavelets June 5, 2003 In this lab, we introduce some basic concepts of wavelet theory and present the essentials required for possible applications of wavelet decompositions for

More information

The Bernstein Mechansim

The Bernstein Mechansim The Bernstein Mechansim diffpriv team July 18, 2017 Abstract This vignette presents a short tutorial on the application of the generic Bernstein mechanism DPMechBernstein for differentially-private release

More information

Stat 8053 Lecture Notes An Example that Shows that Statistical Obnoxiousness is not Related to Dimension Charles J. Geyer November 17, 2014

Stat 8053 Lecture Notes An Example that Shows that Statistical Obnoxiousness is not Related to Dimension Charles J. Geyer November 17, 2014 Stat 8053 Lecture Notes An Example that Shows that Statistical Obnoxiousness is not Related to Dimension Charles J. Geyer November 17, 2014 We are all familiar with the usual mathematics of maximum likelihood.

More information

evmix: An R package for Extreme Value Mixture Modelling, Threshold Estimation and Boundary Corrected Kernel Density Estimation

evmix: An R package for Extreme Value Mixture Modelling, Threshold Estimation and Boundary Corrected Kernel Density Estimation evmix: An R package for Extreme Value Mixture Modelling, Threshold Estimation and Boundary Corrected Kernel Density Estimation Yang Hu University of Canterbury, New Zealand Carl Scarrott University of

More information

Chapter 3: Methods for Generating Random Variables

Chapter 3: Methods for Generating Random Variables Chapter 3: Methods for Generating Random Variables Lecturer: Zhao Jianhua Department of Statistics Yunnan University of Finance and Economics Outline 3.1 Introduction Random Generators of Common Probability

More information

Generating Random Numbers

Generating Random Numbers Generating Random Numbers Seungchul Baek Department of Mathematics and Statistics, UMBC STAT 633: Statistical Computing 1 / 67 Introduction Simulation is a very powerful tool for statisticians. It allows

More information

Interpreting Regression

Interpreting Regression Interpreting Regression January 10, 2018 Contents Standard error of the estimate Homoscedasticity Using R to make interpretations about regresssion Questions In the tutorial on prediction we used the regression

More information

Package Delaporte. August 13, 2017

Package Delaporte. August 13, 2017 Type Package Package Delaporte August 13, 2017 Title Statistical Functions for the Delaporte Distribution Version 6.1.0 Date 2017-08-13 Description Provides probability mass, distribution, quantile, random-variate

More information

Package pearson7. June 22, 2016

Package pearson7. June 22, 2016 Version 1.0-2 Date 2016-06-21 Package pearson7 June 22, 2016 Title Maximum Likelihood Inference for the Pearson VII Distribution with Shape Parameter 3/2 Author John Hughes Maintainer John Hughes

More information

Using R in 200D Luke Sonnet

Using R in 200D Luke Sonnet Using R in 200D Luke Sonnet Contents Working with data frames 1 Working with variables........................................... 1 Analyzing data............................................... 3 Random

More information

Math 70 Homework 8 Michael Downs. and, given n iid observations, has log-likelihood function: k i n (2) = 1 n

Math 70 Homework 8 Michael Downs. and, given n iid observations, has log-likelihood function: k i n (2) = 1 n 1. (a) The poisson distribution has density function f(k; λ) = λk e λ k! and, given n iid observations, has log-likelihood function: l(λ; k 1,..., k n ) = ln(λ) k i nλ ln(k i!) (1) and score equation:

More information

Pembangkitan Bilangan Acak dan Resampling

Pembangkitan Bilangan Acak dan Resampling Pembangkitan Bilangan Acak dan Resampling τρ Pembangkitan Bilangan Acak Resampling Jackknife Bootstrap Topics Random Generators in R Distribution R name Additional Arguments beta beta shape1, shape2, ncp

More information

Technical note: Curve fitting with the R Environment for Statistical Computing

Technical note: Curve fitting with the R Environment for Statistical Computing Technical note: Curve fitting with the R Environment for Statistical Computing D G Rossiter Department of Earth Systems Analysis International Institute for Geo-information Science & Earth Observation

More information

Prediction problems 3: Validation and Model Checking

Prediction problems 3: Validation and Model Checking Prediction problems 3: Validation and Model Checking Data Science 101 Team May 17, 2018 Outline Validation Why is it important How should we do it? Model checking Checking whether your model is a good

More information

Package sklarsomega. May 24, 2018

Package sklarsomega. May 24, 2018 Type Package Package sklarsomega May 24, 2018 Title Measuring Agreement Using Sklar's Omega Coefficient Version 1.0 Date 2018-05-22 Author John Hughes Maintainer John Hughes

More information

1 Conditional Mean and Variance Conditional Mean and Variance Conditional Mean of Financial Return ARCH...

1 Conditional Mean and Variance Conditional Mean and Variance Conditional Mean of Financial Return ARCH... Spring 2017 UAkron Dept. of Stats [3470 : 477/577] Time Series Analysis. Ch 10 : GARCH model Contents 1 Conditional Mean and Variance 2 1.1 Conditional Mean and Variance.......................................................

More information

Chapter 2. Continuous random variables

Chapter 2. Continuous random variables Chapter 2 Continuous random variables Outline Review of probability: events and probability Random variable Probability and Cumulative distribution function Review of discrete random variable Introduction

More information

Introduction to Statistics and R

Introduction to Statistics and R Introduction to Statistics and R Mayo-Illinois Computational Genomics Workshop (2018) Ruoqing Zhu, Ph.D. Department of Statistics, UIUC rqzhu@illinois.edu June 18, 2018 Abstract This document is a supplimentary

More information

Modern Regression HW #6 Solutions

Modern Regression HW #6 Solutions 36-401 Modern Regression HW #6 Solutions Problem 1 [32 points] (a) (4 pts.) DUE: 10/27/2017 at 3PM Given : Chick 50 150 300 50 150 300 50 150 300 50 150 300 Weight 50 150 300 50 150 300 50 150 300 Figure

More information

10.1 Generate n = 100 standard lognormal data points via the R commands

10.1 Generate n = 100 standard lognormal data points via the R commands STAT 675 Statistical Computing Solutions to Homework Exercises Chapter 10 Note that some outputs may differ, depending on machine settings, generating seeds, random variate generation, etc. 10.1 Generate

More information

Simulations. . p.1/25

Simulations. . p.1/25 Simulations Computer simulations of realizations of random variables has become indispensable as supplement to theoretical investigations and practical applications.. p.1/25 Simulations Computer simulations

More information

Robustness and Distribution Assumptions

Robustness and Distribution Assumptions Chapter 1 Robustness and Distribution Assumptions 1.1 Introduction In statistics, one often works with model assumptions, i.e., one assumes that data follow a certain model. Then one makes use of methodology

More information

Frontier Analysis with R

Frontier Analysis with R Summer School on Mathematical Methods in Finance and Economy June 2010 (slides modified in August 2010) Introduction A first simulated example Analysis of the real data The packages about frontier analysis

More information

Chapter 4 Exercises 1. Data Analysis & Graphics Using R Solutions to Exercises (December 11, 2006)

Chapter 4 Exercises 1. Data Analysis & Graphics Using R Solutions to Exercises (December 11, 2006) Chapter 4 Exercises 1 Data Analysis & Graphics Using R Solutions to Exercises (December 11, 2006) Preliminaries > library(daag) Exercise 2 Draw graphs that show, for degrees of freedom between 1 and 100,

More information

Univariate Frequency Analysis Using FAmle

Univariate Frequency Analysis Using FAmle Univariate Frequency Analysis Using FAmle François Aucoin June 12, 2017 1 Introduction FAmle is a R package that may be used in order to carry out tasks that pertain to univariate frequency analysis. Basically,

More information

Week 2 Statistics for bioinformatics and escience

Week 2 Statistics for bioinformatics and escience Week 2 Statistics for bioinformatics and escience Line Skotte 20. november 2008 2.5.1-5) Revisited. When solving these exercises, some of you tried to capture a whole open reading frame by pattern matching

More information

Lecture 09: Sep 19, Randomness. Random Variables Sampling Probability Distributions Caching. James Balamuta STAT UIUC

Lecture 09: Sep 19, Randomness. Random Variables Sampling Probability Distributions Caching. James Balamuta STAT UIUC Lecture 09: Sep 19, 2018 Randomness Random Variables Sampling Probability Distributions Caching James Balamuta STAT 385 @ UIUC Announcements hw03 is due on Friday, Sep 21st, 2018 @ 6:00 PM Quiz 04 covers

More information

EE/CpE 345. Modeling and Simulation. Fall Class 10 November 18, 2002

EE/CpE 345. Modeling and Simulation. Fall Class 10 November 18, 2002 EE/CpE 345 Modeling and Simulation Class 0 November 8, 2002 Input Modeling Inputs(t) Actual System Outputs(t) Parameters? Simulated System Outputs(t) The input data is the driving force for the simulation

More information

R Based Probability Distributions

R Based Probability Distributions General Comments R Based Probability Distributions When a parameter name is ollowed by an equal sign, the value given is the deault. Consider a random variable that has the range, a x b. The parameter,

More information

Introduction to R: Statistics

Introduction to R: Statistics Introduction to R: Statistics Aron C. Eklund Center for Biological Sequence Analysis Technical University of Denmark October 7, 2008 Descriptive statistics Continuous data Categorical data Comparing groups

More information

Problems from Chapter 3 of Shumway and Stoffer s Book

Problems from Chapter 3 of Shumway and Stoffer s Book UNIVERSITY OF UTAH GUIDED READING TIME SERIES Problems from Chapter 3 of Shumway and Stoffer s Book Author: Curtis MILLER Supervisor: Prof. Lajos HORVATH November 10, 2015 UNIVERSITY OF UTAH DEPARTMENT

More information

Package sdprisk. December 31, 2016

Package sdprisk. December 31, 2016 Type Package Version 1.1-5 Date 2016-12-30 Package sdprisk December 31, 2016 Title Measures of Risk for the Compound Poisson Risk Process with Diffusion Maintainer Benjamin Baumgartner

More information

Likelihoods. P (Y = y) = f(y). For example, suppose Y has a geometric distribution on 1, 2,... with parameter p. Then the pmf is

Likelihoods. P (Y = y) = f(y). For example, suppose Y has a geometric distribution on 1, 2,... with parameter p. Then the pmf is Likelihoods The distribution of a random variable Y with a discrete sample space (e.g. a finite sample space or the integers) can be characterized by its probability mass function (pmf): P (Y = y) = f(y).

More information

Metric Predicted Variable on Two Groups

Metric Predicted Variable on Two Groups Metric Predicted Variable on Two Groups Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more information. Goals

More information

Nonstationary time series models

Nonstationary time series models 13 November, 2009 Goals Trends in economic data. Alternative models of time series trends: deterministic trend, and stochastic trend. Comparison of deterministic and stochastic trend models The statistical

More information

STAT 675 Statistical Computing

STAT 675 Statistical Computing STAT 675 Statistical Computing Solutions to Homework Exercises Chapter 3 Note that some outputs may differ, depending on machine settings, generating seeds, random variate generation, etc. 3.1. Sample

More information

Interpreting Regression

Interpreting Regression Interpreting Regression January 27, 2019 Contents Standard error of the estimate Homoscedasticity Using R to make interpretations about regresssion Questions In the tutorial on prediction we used the regression

More information

Exponential, Gamma and Normal Distribuions

Exponential, Gamma and Normal Distribuions Exponential, Gamma and Normal Distribuions Sections 5.4, 5.5 & 6.5 Cathy Poliak, Ph.D. cathy@math.uh.edu Office in Fleming 11c Department of Mathematics University of Houston Lecture 9-3339 Cathy Poliak,

More information

Laboratorio di ST1 Lezione 4

Laboratorio di ST1 Lezione 4 Laboratorio di ST1 Lezione 4 Claudia Abundo Dipartimento di Matematica Università degli Studi Roma Tre 26 Marzo 2010 Gamma?dgamma The Gamma Distribution Description Density, distribution function, quantile

More information

Case Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016

Case Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016 Case Study: Modelling Industrial Dryer Temperature Arun K. Tangirala 11/19/2016 Background This is a case study concerning time-series modelling of the temperature of an industrial dryer. Data set contains

More information

Robust Inference in Generalized Linear Models

Robust Inference in Generalized Linear Models Robust Inference in Generalized Linear Models Claudio Agostinelli claudio@unive.it Dipartimento di Statistica Università Ca Foscari di Venezia San Giobbe, Cannaregio 873, Venezia Tel. 041 2347446, Fax.

More information

Prof. Thistleton MAT 505 Introduction to Probability Lecture 13

Prof. Thistleton MAT 505 Introduction to Probability Lecture 13 Prof. Thistleton MAT 55 Introduction to Probability Lecture 3 Sections from Text and MIT Video Lecture: Sections 5.4, 5.6 http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-4- probabilisticsystems-analysis-and-applied-probability-fall-2/video-lectures/lecture-8-continuousrandomvariables/

More information

Statistics II: Estimating simple parametric models

Statistics II: Estimating simple parametric models Statistics II: Estimating simple parametric models Richard Gill March 6, 2009 First of all we look at a normal plot of a sample from the t distribution with 9 degrees of freedom (and before that, we set

More information

Quantitative Methods in Linguistics Lecture 4

Quantitative Methods in Linguistics Lecture 4 Quantitative Methods in Linguistics Lecture 4 Adrian Brasoveanu March 30, 2014 Contents 1 Elementary Control (of) Flow Structures 2 1.1 IF..................................................... 2 1.2 FOR....................................................

More information

Introduction to R and Programming

Introduction to R and Programming Introduction to R and Programming Nathaniel E. Helwig Assistant Professor of Psychology and Statistics University of Minnesota (Twin Cities) Updated 04-Jan-2017 Nathaniel E. Helwig (U of Minnesota) Introduction

More information

2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling

2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling 2017 SISG Bayesian Statistics for Genetics R Notes: Generalized Linear Modeling Jon Wakefield Departments of Statistics and Biostatistics, University of Washington 2017-09-05 Overview In this set of notes

More information

Package GPfit. R topics documented: April 2, Title Gaussian Processes Modeling Version Date

Package GPfit. R topics documented: April 2, Title Gaussian Processes Modeling Version Date Title Gaussian Processes Modeling Version 1.0-0 Date 2015-04-01 Package GPfit April 2, 2015 Author Blake MacDoanld, Hugh Chipman, Pritam Ranjan Maintainer Hugh Chipman Description

More information

EE/CpE 345. Modeling and Simulation. Fall Class 9

EE/CpE 345. Modeling and Simulation. Fall Class 9 EE/CpE 345 Modeling and Simulation Class 9 208 Input Modeling Inputs(t) Actual System Outputs(t) Parameters? Simulated System Outputs(t) The input data is the driving force for the simulation - the behavior

More information

The psyphy Package. September 1, 2007

The psyphy Package. September 1, 2007 Type Package The psyphy Package September 1, 2007 Title Functions for analyzing psychophysical data in R Version 0.0-5 Date 2007-08-29 Author Kenneth Knoblauch Maintainer Ken Knoblauch

More information

Online Appendix to Mixed Modeling for Irregularly Sampled and Correlated Functional Data: Speech Science Spplications

Online Appendix to Mixed Modeling for Irregularly Sampled and Correlated Functional Data: Speech Science Spplications Online Appendix to Mixed Modeling for Irregularly Sampled and Correlated Functional Data: Speech Science Spplications Marianne Pouplier, Jona Cederbaum, Philip Hoole, Stefania Marin, Sonja Greven R Syntax

More information

Topic 15: Simple Hypotheses

Topic 15: Simple Hypotheses Topic 15: November 10, 2009 In the simplest set-up for a statistical hypothesis, we consider two values θ 0, θ 1 in the parameter space. We write the test as H 0 : θ = θ 0 versus H 1 : θ = θ 1. H 0 is

More information

R-companion to: Estimation of the Thurstonian model for the 2-AC protocol

R-companion to: Estimation of the Thurstonian model for the 2-AC protocol R-companion to: Estimation of the Thurstonian model for the 2-AC protocol Rune Haubo Bojesen Christensen, Hye-Seong Lee & Per Bruun Brockhoff August 24, 2017 This document describes how the examples in

More information

The normalp Package. October 2, 2007

The normalp Package. October 2, 2007 Version 0.6.7 Date 2007-10-01 The normal Package October 2, 2007 Title Package for exonential ower distributions (EPD) Author Maintainer Deends R (>=

More information

Chapter 3. Chapter 3 sections

Chapter 3. Chapter 3 sections sections 3.1 Random Variables and Discrete Distributions 3.2 Continuous Distributions 3.4 Bivariate Distributions 3.5 Marginal Distributions 3.6 Conditional Distributions 3.7 Multivariate Distributions

More information

Theory of Inference: Homework 4

Theory of Inference: Homework 4 Theory of Inference: Homework 4 1. Here is a slightly technical question about hypothesis tests. Suppose that Y 1,..., Y n iid Poisson(λ) λ > 0. The two competing hypotheses are H 0 : λ = λ 0 versus H

More information

Metric Predicted Variable With One Nominal Predictor Variable

Metric Predicted Variable With One Nominal Predictor Variable Metric Predicted Variable With One Nominal Predictor Variable Tim Frasier Copyright Tim Frasier This work is licensed under the Creative Commons Attribution 4.0 International license. Click here for more

More information

Lecture 10: Sep 24, v2. Hypothesis Testing. Testing Frameworks. James Balamuta STAT UIUC

Lecture 10: Sep 24, v2. Hypothesis Testing. Testing Frameworks. James Balamuta STAT UIUC Lecture 10: Sep 24, 2018 - v2 Hypothesis Testing Testing Frameworks James Balamuta STAT 385 @ UIUC Announcements hw04 is due Friday, Sep 21st, 2018 at 6:00 PM Quiz 05 covers Week 4 contents @ CBTF. Window:

More information

R Functions for Probability Distributions

R Functions for Probability Distributions R Functions for Probability Distributions Young W. Lim 2018-03-22 Thr Young W. Lim R Functions for Probability Distributions 2018-03-22 Thr 1 / 15 Outline 1 R Functions for Probability Distributions Based

More information

1, 0 r 1 f R (r) = 0, otherwise. 1 E(R 2 ) = r 2 f R (r)dr = r 2 3

1, 0 r 1 f R (r) = 0, otherwise. 1 E(R 2 ) = r 2 f R (r)dr = r 2 3 STAT 5 4.43. We are given that a circle s radius R U(, ). the pdf of R is {, r f R (r), otherwise. The area of the circle is A πr. The mean of A is E(A) E(πR ) πe(r ). The second moment of R is ( ) r E(R

More information

Probability theory and inference statistics! Dr. Paola Grosso! SNE research group!! (preferred!)!!

Probability theory and inference statistics! Dr. Paola Grosso! SNE research group!!  (preferred!)!! Probability theory and inference statistics Dr. Paola Grosso SNE research group p.grosso@uva.nl paola.grosso@os3.nl (preferred) Roadmap Lecture 1: Monday Sep. 22nd Collecting data Presenting data Descriptive

More information

Lecture 6 Exploratory data analysis Point and interval estimation

Lecture 6 Exploratory data analysis Point and interval estimation Lecture 6 Exploratory data analysis Point and interval estimation Dr. Wim P. Krijnen Lecturer Statistics University of Groningen Faculty of Mathematics and Natural Sciences Johann Bernoulli Institute for

More information

Introduction to Algorithmic Trading Strategies Lecture 10

Introduction to Algorithmic Trading Strategies Lecture 10 Introduction to Algorithmic Trading Strategies Lecture 10 Risk Management Haksun Li haksun.li@numericalmethod.com www.numericalmethod.com Outline Value at Risk (VaR) Extreme Value Theory (EVT) References

More information

Canadian climate: function-on-function regression

Canadian climate: function-on-function regression Canadian climate: function-on-function regression Sarah Brockhaus Institut für Statistik, Ludwig-Maximilians-Universität München, Ludwigstraße 33, D-0539 München, Germany. The analysis is based on the

More information

This produces (edited) ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = aircondit, statistic = function(x, i) { 1/mean(x[i, ]) }, R = B)

This produces (edited) ORDINARY NONPARAMETRIC BOOTSTRAP Call: boot(data = aircondit, statistic = function(x, i) { 1/mean(x[i, ]) }, R = B) STAT 675 Statistical Computing Solutions to Homework Exercises Chapter 7 Note that some outputs may differ, depending on machine settings, generating seeds, random variate generation, etc. 7.1. For the

More information

Consider fitting a model using ordinary least squares (OLS) regression:

Consider fitting a model using ordinary least squares (OLS) regression: Example 1: Mating Success of African Elephants In this study, 41 male African elephants were followed over a period of 8 years. The age of the elephant at the beginning of the study and the number of successful

More information

Dr. Junchao Xia Center of Biophysics and Computational Biology. Fall /13/ /12

Dr. Junchao Xia Center of Biophysics and Computational Biology. Fall /13/ /12 BIO5312 Biostatistics R Session 03: Random Number and Probability Distributions Dr. Junchao Xia Center of Biophysics and Computational Biology Fall 2016 9/13/2016 1 /12 Random Number Generator Random number

More information