time series 时间序列 | fractional factorial design 部分要因试验设计

作业: 

1) A plot of data from a time series, which shows a cyclical pattern – please show a time series plot and identify the length of the major cycle. 

2) Data from a full factorial or fractional factorial experiment with at least 2 factors – please identify the factors and the dependent variable. It is sufficient to provide me with a small part of the dataset (e.g. 10 records), if the dataset is large.

slides for FFD

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
kings <- scan("http://robjhyndman.com/tsdldata/misc/kings.dat",skip=3)
kings
kingstimeseries <- ts(kings)
kingstimeseries
# An example is a data set of the number of births per month in New York city, from January 1946 to December 1959
births <- scan("http://robjhyndman.com/tsdldata/data/nybirths.dat")
birthstimeseries <- ts(births, frequency=12, start=c(1946,1))
birthstimeseries
#
souvenir <- scan("http://robjhyndman.com/tsdldata/data/fancy.dat")
souvenirtimeseries <- ts(souvenir, frequency=12, start=c(1987,1))
souvenirtimeseries
#
plot.ts(kingstimeseries)
#
plot.ts(birthstimeseries)
#
plot.ts(souvenirtimeseries)
#
logsouvenirtimeseries <- log(souvenirtimeseries)
plot.ts(logsouvenirtimeseries)
#
library("TTR")
birthstimeseriescomponents <- decompose(birthstimeseries)
birthstimeseriescomponents$seasonal
# get the estimated values of the seasonal component
plot(birthstimeseriescomponents)
#
birthstimeseriescomponents <- decompose(birthstimeseries)
birthstimeseriesseasonallyadjusted <- birthstimeseries - birthstimeseriescomponents$seasonal
plot(birthstimeseriesseasonallyadjusted)

  

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#tell where the data come from
datafilename="http://personality-project.org/R/datasets/R.appendix1.data"
#read the data
data.ex1=read.table(datafilename,header=T)
#do the analysis
aov.ex1 = aov(Alertness~Dosage,data=data.ex1)
#show the table
summary(aov.ex1)
 
# 2-way
datafilename="http://personality-project.org/r/datasets/R.appendix2.data"
#read the data
data.ex2=read.table(datafilename,header=T)
#show the data
data.ex2
#do the analysis
aov.ex2 = aov(Alertness~Gender*Dosage,data=data.ex2)
#show the summary table
summary(aov.ex2)

 

后面贴答案  

 

posted @   Life·Intelligence  阅读(534)  评论(0编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2018-04-16 管家基因 | Human housekeeping genes
2018-04-16 各国脑计划概览
TOP
点击右上角即可分享
微信分享提示