2a44c133f07f902bf93219dfdedd3582aa5e775b.xls
A
B
C
D
E
F
1 Westland Wranglers
2
Average Horses Captured per Day
4
3
Average Sales Demand per Day
4.1
4
Sales Price Per Horse $ 150.00
5
"Salvage" Value of Horses in Corral at End $ 130.00
6
Cost per Day of K
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Classes and objects
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming - Papadimitriou
2
Founda
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Introduction
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming - Papadimitriou
2
Why Programmi
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Interfaces, inheritance, and polymorphism
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming -
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Control flow: conditionals and loops
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming - Papad
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Functions and modules
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming - Papadimitriou
Course
Foundations of Programming - Papadimitriou
1
FOUNDATIONS OF BUSINESS
PROGRAMMING
Arrays
Spiros Papadimitriou
includes slides based upon material by
Robert Sedgewick & Kevin Wayne (Princeton)
Foundations of Programming - Papadimitriou
Course overview
2
Fou
# In rstudio, install package quantmod
# load package
library(quantmod)
library(fpp)
# this is the three month t-bill rate. Note this is in percentage.
tb3=getSymbols('TB3MS',src='FRED', from='2008', auto.assign = FALSE)
# this is to obtain the t-bill ra
y = response variable (dependent)
x = explanatory variable (independent)
RSS = Residual sum of squares ~ sum of squared errors
Multiple R squared measures how close your predicted value is with respect to the true value
AIC = n log(SSE/n) + 2(K+2)
Time se
With a moving average model
the dependency in the MA model has a cutoff effect,
MA(1) cuts off after 1 lag
any theta will give you a stationary process
autoregressive model
it exponentially decays.the acf gradually goes to 0 and then stays there
higher co
simple linear regression
E follows a normal distribution, mean 0 E~N(0,sigma^2)
E(y) = B0 + B1 X + E(E)
error is the difference btwn the point and the true line(Y(hat) = B0(hat) + B1(hat) X)
Error is something you do not observe
The distance between the p
rnorm - generate normal random variables
rt - generate random t distribution
rpois - generate random poisson numbers
fun-name <- function(x)
cfw_ y=x^2
return(y)
-random variable - mapping from event to probability
sigma(x bar) = sigma/root(n)
margin of
for case study use the last year as the testing data set
use the first 14 years to come up with the model
f(x1,x2,x3) = f(x5,52,53) .only the distance matters, not the actual location
cov(x2, x8) = gamma(6) = cov(x3, x9) only when stationary if the lag do
Forecasting: principles and practice
otexts.com/fpp
time series analysis and its applications: with R examples
robert shumway and david stoffer
have R and R studio installed
-inclass.R
y<- means that y is assigned to something
y<-4 y assigned to 4
rm(x,y)
stationarity - you only have one sample size in time series
use the pattern over different times to do inferencing
stability assumption.the behavior of the time series is the same at all time periods
the distribution of x1 is the same as the dist of x2.
E
1. Which time-series component is said to fluctuate around the long-term trend and is fairly irregular in appearance? A) Trend. B)
Cyclical. C) Seasonal. D) Irregular. E) None.
2. Which measure of dispersion in a data set is the most intuitive and represe
Samantha Komosinski
10/16/14
Homework 3
Part One
1.
In this plot, we see that the variance is not at a constant rate as time goes on, showing the
datas seasonality. We use would have to use the function HoltWinters() to execute
exponential smoothing. Beca
Samantha Komosinski
PART 1
1.
2.
3.
10/02/14
Homework 2
Samantha Komosinski
10/02/14
Homework 2
My stock has a weakly positive correlation between its risk premiums compared to that of
SP500 in the market. My stock presents data with many outliers, which
Samantha Komosinski
Homework One
09/16/14
1.
2.
The first command multiplied each individual output of 1:5 by 2, then listing those products.
However, the second command first multiplied 2*1, making the command then say 2:5, and
therefore listing 2 throug
A stationary time series is one whose properties do not depend on the time at which the series is observed
o time series with trends, or with seasonality, are not stationary; cyclic behavior (but not trend or seasonality) is stationary
o Stationary = no
SMOOTHING
Be able to fit graph to data
Monthly will be 12, weekly 7, etc (depends on seasonality)
Degree of smoothing is controlled by alpha
Fitted value is multiple times series where column is leveled series (level + trend +
seasonal component = first c
4 point moving average
(xt-2 + xt-1 + xt + xt+1)
centered 4 point moving average
2x4 MA
Do yt and yt+1 and do the average of them
for smoothing.if alpha is small, we are relying more and more on the past values
difference between s.window and t.window an
Differencing (makes the variance the same.another way instead of log transform)
Xt - X(t-1) = D(Xt) = rt
drift=delta=trend component
slope is delta
the trend line is delta(T) line
xt = delta t + sigma(Wi)
Var (xt) = Var (delta t + sigma(Wi)
= Var( sigma (
FINAL EXAM REVIEW
If at least one beta is <1, time series is not stationary
o
backshift operators and definition
Definition of autocorrelation
Properties of ma and ar models
o
Stationary conditions
o
Compute mean of series
ma (intercept is mean) and ar (c
Smoothing One: Dont have trend or seasonal component
Exponential as alpha gets smaller, the weight that you put on the past increases
Choose an alpha that minimizes sum of squared errors
The data thats in the past in sample
The data that you did not use i