Skip to content

Commit

Permalink
version 2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Thibault Laurent authored and cran-robot committed Nov 15, 2022
1 parent 2e3880f commit dc156f3
Show file tree
Hide file tree
Showing 80 changed files with 696 additions and 729 deletions.
10 changes: 5 additions & 5 deletions DESCRIPTION 100644 → 100755
Expand Up @@ -2,17 +2,17 @@ Package: caschrono
Title: S<e9>ries Temporelles Avec R
Description: Functions, data sets and exercises solutions for the book 'S�ries Temporelles Avec R' (Yves Aragon, edp sciences, 2016). For all chapters, a vignette is available with some additional material and exercises solutions.
Encoding: latin1
Version: 2.2
Date: 2020-05-12
Version: 2.3
Date: 2022-12-14
Author: Yves Aragon
Maintainer: Thibault Laurent <Thibault.Laurent@univ-tlse1.fr>
Depends: graphics, stats, utils, zoo
Imports: Hmisc, methods
Suggests: dse, expsmooth, fBasics, FitARMA, fGarch, forecast, polynom,
Suggests: dse, expsmooth, fBasics, fGarch, forecast, polynom,
timeSeries, xtable
License: GPL (>= 2)
URL: http://www.seriestemporelles.com
NeedsCompilation: no
Packaged: 2020-05-12 15:35:06 UTC; thibault
Packaged: 2022-11-14 14:29:46 UTC; laurent
Repository: CRAN
Date/Publication: 2020-05-12 16:20:07 UTC
Date/Publication: 2022-11-15 23:30:12 UTC
79 changes: 40 additions & 39 deletions MD5
@@ -1,14 +1,14 @@
8a048cddefe65c126f82431b6b3d06bb *DESCRIPTION
af1ecad93065741200e0aee25187f36e *DESCRIPTION
04203139f51701835ff7068006b21939 *NAMESPACE
ba974b797edd0f6e24cdd109217eba9a *R/Box.test.2.R
d581251d9e66e1d5b296679daf2e7c06 *R/acf2y.R
528a0502271fb8ccef1ded9061b4f78d *R/armaselect.r
02f48e0a3b853049d7cf8e6f59e82f00 *R/cor.arma.r
d90a2b266fea2cadc942e359ce0284b9 *R/plot2acf.R
65fd507185138da8f7a519dbbc1ee420 *R/plotacfthemp.r
7e2d62b29d77a09eb0ce96a1b85320fb *R/t_stat.r
5c517432dd91af0375b07ba802808913 *R/xy.acfb.r
460a6c0197c3500a74fb60dea2ede973 *build/vignette.rds
e19853957155e5207c9b3c26268b2f38 *R/Box.test.2.R
8b80fd7855d59e256b9c56b8f40745f5 *R/acf2y.R
f8928e92b06795a4e7fff82c2fdadb44 *R/armaselect.r
3aa7fd680ab11e6762b7496b15a8b39b *R/cor.arma.r
2d99d6107f2659327f5187787574ba9e *R/plot2acf.R
1c0d40ce7a311763eff9172800d3592b *R/plotacfthemp.r
d9645026a40125623d9a65f505e45fe3 *R/t_stat.r
87a4a72e4e55c68731269b72f3ccb3a8 *R/xy.acfb.r
8029401002eded9891a9cbec4fd00139 *build/vignette.rds
b363921c7bc4712a5011ffb72e20b972 *data/champa.ts.rda
64754290d41ebb37b3a9f9df4242a759 *data/csdl.RData
421e6a66d19f1015af13c2ad641c3fb7 *data/essil.RData
Expand All @@ -21,64 +21,65 @@ be4f5997433563911a3a032df25f5855 *data/indbourse.RData
e0a1159418f157790ec04799738d3b71 *inst/CITATION
8dd686a282d25f557c710eb15829429a *inst/doc/Anx1.R
35778f533a50923f678dbc3d986e21fd *inst/doc/Anx1.Rnw
c8dd655654ff4d1c539845da67734e24 *inst/doc/Anx1.pdf
47c0a89a1fd3965c3efc6bf8b622f79c *inst/doc/Anx1.pdf
2f26ecf539bb9ad2a2e03d166aec097c *inst/doc/Anx10.R
5e716979e76cf558a31d63c340e5efeb *inst/doc/Anx10.Rnw
817bd61bcfa72a175836a9d13803b2e3 *inst/doc/Anx10.pdf
3f0a7a1fb13bde948c5713e6ac5d128d *inst/doc/Anx12.R
2e4e8a80faec39516bcde3d28c55b9c7 *inst/doc/Anx12.Rnw
131c6815c92133a42c6a47ff085284e2 *inst/doc/Anx12.pdf
7c41779b3dbf20f67c324e56994b9f70 *inst/doc/Anx10.pdf
992706c033da8e4098927b433d94e797 *inst/doc/Anx12.R
8cce130c635cc84b04dfd4dd50941e2b *inst/doc/Anx12.Rnw
4d4dc63782b43767ca30fe055e5d181c *inst/doc/Anx12.pdf
ba25e603cd0acefe4cefa9a1ef68fa2e *inst/doc/Anx2.R
4ee09538f49a888360bae694856fb427 *inst/doc/Anx2.Rnw
30cc6453ba32807679c78cbd52465eb0 *inst/doc/Anx2.pdf
786d05f2ecebd3ba9b88579f5e057dfd *inst/doc/Anx2.pdf
aff972d89fba2aa729a24e91fc2482f4 *inst/doc/Anx3.R
1230799fab19d4bdcc873e7ba2df77d3 *inst/doc/Anx3.Rnw
261ee85e5f53b34b3461d3e890f4bee6 *inst/doc/Anx3.pdf
2f376a5e75dcb550f17da5de08dd24de *inst/doc/Anx4.R
1419a5945249775dc79a3182968b7e8c *inst/doc/Anx4.Rnw
8d4d9c1e37d8f7a767246c5805609f87 *inst/doc/Anx4.pdf
dae39435c27853e019dd9dfe7f77aaee *inst/doc/Anx3.pdf
8137fc5d86b6f09f43ec5d030e02cfe1 *inst/doc/Anx4.R
2d946eafd7d7d69694ef1b70f9d9d5ec *inst/doc/Anx4.Rnw
4ba1ca569f2f9a9768beff5f6d553b3f *inst/doc/Anx4.pdf
cd84360f99c151f362f6e3d1a74f5eeb *inst/doc/Anx5.R
06c2411350b8c4bdcfce2094465fd76d *inst/doc/Anx5.Rnw
9d2278681dfdf0f189fb2926aacfde10 *inst/doc/Anx5.pdf
c183de874c2604f5b59c923aed7b11d4 *inst/doc/Anx5.pdf
10507650700cb9c7c7894e3d7da21756 *inst/doc/Anx6.R
5674fee8a18aee982f21efb3bd54b4cd *inst/doc/Anx6.Rnw
f7fa468ec1b5f5be496ce585157596b3 *inst/doc/Anx6.pdf
e14a38380b200c8082edfd598a2cd614 *inst/doc/Anx6.pdf
f349a01c70e55dfef6df1b02c0080622 *inst/doc/Anx7.R
90c6a3742945a3cbb762cc9a1e05421f *inst/doc/Anx7.Rnw
0db901cfec166e3fdaf0f15ecdb3c0c3 *inst/doc/Anx7.pdf
4550f295ed0d4fa21447061d718a7aff *inst/doc/Anx7.pdf
d027e42272fee1b842ed72c1990aec7b *inst/doc/Anx9.R
78164a7cd351e7eeb18539c8a32aa95f *inst/doc/Anx9.Rnw
e3ccd177274fb1daa0528e09bd5ba160 *inst/doc/Anx9.pdf
84b28d305420bc8c588a8885c642661b *inst/doc/Anx9.pdf
92f98b394468a05ee4acf8328caff86f *inst/doc/sortie.pdf
e811acbf5a09f59fafcf26e7554340d2 *inst/import/Tel_extrait.csv
1ec0c47722499bbe15ff264e5c4028c2 *inst/import/champagne_2001.txt
6b35efac7e40023f57c13b822ef49dc3 *inst/import/collecteLait.txt
011e245f497d8127159f7bf52dd6661c *inst/import/conselec.csv
545db1774c5247a5af56469ea8911445 *inst/import/trafquoti.txt
8e6f4cec33bd8c00b8b4d294cca02a8d *man/Box.test.2.rd
e286ec3c1c33c4a7220dbb8b12810c0f *man/Tel_extrait.Rd
3212333dcdaf44ea4d4ac47ca53b08ad *man/acf2y.rd
aa5edf6b3a7d5066994c8ebfe698e0a7 *man/Box.test.2.rd
d93523c1710159fbc2b7abb6d857f73b *man/Tel_extrait.Rd
e3e53c7884fa097b0b55adcc5992150d *man/acf2y.rd
42ab909eb5dd533be39dfb66fe75a5a8 *man/armaselect.rd
c5b935803086c2381b022a141c2a6e62 *man/caschrono-package.Rd
3e15ecbc47174b712c0938759fa3417c *man/champa.ts.Rd
320a5b01f396bb607972fe9c172bde5d *man/caschrono-package.Rd
4ffefcd66f455c39d18f677cb601cb30 *man/champa.ts.Rd
7e08e689f4d8aa0250d46f578471886d *man/cor.arma.rd
310f6fdeb7f9f591aa42b06858ba8b5b *man/csdl.rd
f334371387d83a9e4ad67879b4c98219 *man/csdl.rd
31e141ae11ab8bbd42ed4bad4a43c92f *man/essil.rd
84c9b8199f2177d7adccd7948183bdd6 *man/indbourse.rd
3d377cf2167d08358fb367fa3a9bee65 *man/khct.rd
b301f9859f101ccc256a16049db5a329 *man/lait.Rd
8dc037c581c2d91c360ddac8047638ca *man/m30.Rd
934782ef76b1878cf7b729470c69cea5 *man/plot2acf.Rd
5d133b7ef15d1704cb903bb8da87476a *man/plotacfthemp.rd
4ff0f0cca22f17b3eda8c059fb424c70 *man/popfr.Rd
6f808a5c6deda5537b87d7f4e1fc7de9 *man/t_stat.rd
68906c790cb6b921c2b74e53a51ad41d *man/khct.rd
646001734fc4e71d1258f90a4c90a8f0 *man/lait.Rd
76e5b708f7c188c9c6ffd51a0b297b63 *man/m30.Rd
ae08e6278679fec6c0e6533d5f4670aa *man/plot2acf.Rd
9817774305a2924c3e7cefba383a2e1d *man/plotacfthemp.rd
be27147f4858ce0798f9d88a39a97e37 *man/popfr.Rd
64c17d2118131703d3126758653e5620 *man/t_stat.rd
7e7bee448755cffcaf59ed90a379ab43 *man/trafmensu.rd
7fbdd84772591ed7349d40bc3165b623 *man/xy.acfb.rd
35778f533a50923f678dbc3d986e21fd *vignettes/Anx1.Rnw
5e716979e76cf558a31d63c340e5efeb *vignettes/Anx10.Rnw
2e4e8a80faec39516bcde3d28c55b9c7 *vignettes/Anx12.Rnw
8cce130c635cc84b04dfd4dd50941e2b *vignettes/Anx12.Rnw
4ee09538f49a888360bae694856fb427 *vignettes/Anx2.Rnw
1230799fab19d4bdcc873e7ba2df77d3 *vignettes/Anx3.Rnw
1419a5945249775dc79a3182968b7e8c *vignettes/Anx4.Rnw
2d946eafd7d7d69694ef1b70f9d9d5ec *vignettes/Anx4.Rnw
06c2411350b8c4bdcfce2094465fd76d *vignettes/Anx5.Rnw
5674fee8a18aee982f21efb3bd54b4cd *vignettes/Anx6.Rnw
90c6a3742945a3cbb762cc9a1e05421f *vignettes/Anx7.Rnw
Expand Down
Empty file modified NAMESPACE 100644 → 100755
Empty file.
26 changes: 10 additions & 16 deletions R/Box.test.2.R 100644 → 100755
@@ -1,17 +1,11 @@
Box.test.2 = function(x, nlag,type=c("Box-Pierce","Ljung-Box"), fitdf = 0, decim=8)
{

Box.test.inv = function(lag1,x,type = c("Box-Pierce", "Ljung-Box"), fitdf = 0)
{
# fonction Box.test mais avec ses arguments inversés pour pouvoir faire un apply
#lag1=3
Box.test(x,lag1, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0)$p.value
}

x=as.vector(x)
nlag = as.matrix(nlag)
aa= round(apply(nlag,1,Box.test.inv,x), digits=decim)
bb = cbind(as.integer(nlag),as.matrix(aa))
colnames(bb) = c("Retard", "p-value")
bb
Box.test.2 <- function(x, nlag, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0, decim=8) {
Box.test.inv = function(lag1, x, type = c("Box-Pierce", "Ljung-Box"), fitdf = 0) {
stats::Box.test(x, lag1, type = c("Box-Pierce", "Ljung-Box"), fitdf = fitdf)$p.value
}
x <- as.vector(x)
nlag <- as.matrix(nlag)
aa <- round(apply(nlag, 1, Box.test.inv, x), digits = decim)
bb <- cbind(as.integer(nlag), as.matrix(aa))
colnames(bb) <- c("Retard", "p-value")
bb
}
88 changes: 47 additions & 41 deletions R/acf2y.R 100644 → 100755
@@ -1,41 +1,47 @@
acf2y <- function(y, lag.max=40, numer=TRUE)
{
# fonction de Shumway modifiée
num <- length(y)
ACF1 <- stats::acf(as.vector(y), lag.max, plot=FALSE)$acf[-1,1,1]
PACF <- stats::pacf(as.vector(y), lag.max, plot=FALSE)$acf[,1,1]
LAG <- 1:lag.max
minA <- min(ACF1); minP <- min(PACF)
maxA <- max(ACF1); maxP <- max(PACF)
U <- 2/sqrt(num)
L <- -U
minu <- max(-1, min(minA, minP, L)-.01) ; maxu <- min(1, max(maxA, maxP) + 0.05)

############### paramètres graphiques
mai.n = c(0, 0.8, 0.4, 0.1) # marges en pouces
mai.s = c(0.9, mai.n[2], 0, 0.1)
lar = 7 ; hau=7; # largeur et hauteur totales en pouces
a = lar-mai.n[2] # largeur de chaque graphique
b = (hau-mai.s[1]-mai.n[3])/2 # hauteur de chaque graphique
# figure du haut
(fig.n = c(0, 1, (mai.s[1]+b)/hau, 1))
# figures du bas
(fig.s = c(0, 1, 0, (mai.s[1]+b)/hau))
############# figure du haut
op1 = par(fig=fig.n,mai=mai.n)
plot(LAG, ACF1, type="h", ylim=c(minu,maxu), xlab="", xaxt="n", ylab="ACF",
main=paste("Time series: ", deparse(substitute(y))), cex=.8, las=1,
cex.lab=0.9, cex.axis=.8)
abline(h=0)
abline(h=L, lty="dashed", col="blue")
abline(h=U, lty="dashed", col="blue")
# ############ figure du bas
op2 = par(new=TRUE, fig=fig.s ,mai=mai.s)
plot(LAG, PACF, type="h", ylim=c(minu,maxu), xlab="Lag", ylab="PACF", cex=.8, las=1, cex.lab=0.9, cex.axis=.8)
abline(h=0)
abline(h=L, lty="dashed", col="blue")
abline(h=U, lty="dashed", col="blue")
par(op2)
par(op1)
if(numer) return(cbind(LAG, ACF1, PACF))
}
acf2y <- function(y, lag.max=40, numer=TRUE) {
# Shumway function modified
num <- length(y)
ACF1 <- stats::acf(as.vector(y), lag.max, plot=FALSE)$acf[-1,1,1]
PACF <- stats::pacf(as.vector(y), lag.max, plot=FALSE)$acf[,1,1]
LAG <- 1:lag.max
minA <- min(ACF1)
minP <- min(PACF)
maxA <- max(ACF1)
maxP <- max(PACF)
U <- 2/sqrt(num)
L <- -U
minu <- max(-1, min(minA, minP, L) - .01)
maxu <- min(1, max(maxA, maxP) + 0.05)

############### graphical parameters
mai.n <- c(0, 0.8, 0.4, 0.1)
mai.s <- c(0.9, mai.n[2], 0, 0.1)
lar <- 7
hau <- 7
a <- lar - mai.n[2]
b <- (hau - mai.s[1] - mai.n[3]) / 2
fig.n <- c(0, 1, (mai.s[1] + b) / hau, 1)
fig.s <- c(0, 1, 0, (mai.s[1] + b) / hau)

############# 1st figure
op1 <- par(fig = fig.n, mai = mai.n)
plot(LAG, ACF1, type = "h", ylim = c(minu, maxu), xlab = "",
xaxt = "n", ylab = "ACF", main = paste("Time series: ", deparse(substitute(y))),
cex = .8, las = 1, cex.lab = 0.9, cex.axis = .8)
abline(h = 0)
abline(h = L, lty = "dashed", col = "blue")
abline(h = U, lty = "dashed", col = "blue")

# ############ 2nd figure
op2 <- par(new = TRUE, fig = fig.s, mai = mai.s)
plot(LAG, PACF, type = "h", ylim = c(minu, maxu), xlab = "Lag",
ylab = "PACF", cex = .8, las = 1, cex.lab = 0.9, cex.axis = .8)
abline(h = 0)
abline(h = L, lty = "dashed", col = "blue")
abline(h = U, lty = "dashed", col = "blue")
par(op2)
par(op1)
# return result
if (numer)
return(cbind(LAG, ACF1, PACF))
}

0 comments on commit dc156f3

Please sign in to comment.