In the code below, I am trying to cycle through csv files and calculate the correlation between two columns for each file. The results are being stored in an empty vector.
For example: the first file has name "001.csv". The for loop will calculate the correlation between the 2nd and 3rd column and store it in the 1st position of the results vector. This will continue to iterate until to the end of the loop.
For some reason the following error keep occuring:
Error in file(file, "rt") : invalid 'description' argument
The code I am trying to execute is:
corr <- function(directory, threshold = 0) {
## defining the directory
path = paste("C:/Users/name/Desktop/R/R Working Directory/",directory,"/", sep="", collapse="")
directory1 <- dir(path, pattern=".csv")
data.set <- complete(directory,) ##calling in the dataset to find correlation on
data.setDIM <- dim(data.set) ##using the dim to filter data in for loop
filter.data <- data.frame(matrix(,,2))
result <- vector()
for(i in i:data.setDIM[1])
{ if( data.set[i,2] >= threshold)
{ filter.data[i,1]<-data.set[i,1]
filter.data[i,2]<-data.set[i,2] }
}
filter.data <- na.omit(filter.data) ##removing the NA values
## Performing corr() function. I will use the 1st column of filter.data to identify the files to read and perform calc on.
for(j in c(filter.data[1]))
{ file <- na.omit(read.csv(paste(path,directory1[j],sep="",colapse="")))
result[j] <- cor(file[2],file[3])
}
result
}
The c(filter.data[1]) gives me a vector of integers that I want to index through. I've printed out an example below.
[1] 21 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
[19] 41 44 45 47 49 50 51 52 53 54 55 56 57 58 59 60 61 62
[37] 63 64 66 67 68 71 72 74 75 76 77 78 80 83 84 86 87 88
[55] 89 91 93 94 96 97 98 99 103 104 105 108 109 110 111 112 113 114
[73] 115 116 117 119 120 121 122 123 124 125 127 128 131 132 133 136 138 139
[91] 140 141 142 143 144 145 147 148 149 150 151 152 153 154 156 158 160 164
[109] 165 166 167 168 170 171 172 173 174 176 177 178 179 180 181 182 183 184
[127] 185 186 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203
[145] 205 209 210 213 214 215 216 217 218 219 220 221 222 223 225 227 228 229
[163] 230 231 232 234 239 240 241 242 243 244 245 246 247 248 249 250 252 253
[181] 254 255 257 258 260 262 263 265 266 267 268 269 270 271 272 273 277 279
[199] 287 299 300 301 302 303 305 306 307 309 310 312 313 314 315 318 320 321
[217] 322 325 326 327 328 329 330 331
Related
I'd like to do several manipulations with datasets that are in-built in R from the packages that I have. So, first, I made a vector with dataset's names, but when I tried to filter the datasets which have only one column, I got an error, saying that the length of the argument is 0. Here is the code:
for (i in datasets){
if (ncol(i)==1){dataset <- i datasets <- c(dataset, datasets) }
}
It treats the names of the datasets as a character vector.
Here is the head of the aforementioned vector: [1] ability.cov airmiles AirPassengers airquality anscombe attenu. It's silly, but how could I treat the entries as dataframes?
I don't fully understand your logic, but based on your code, you want to identify which dataset that has one column by using ncol(x) == 1. If that's true, then you need to deal with some issues:
the various structures of the datasets. ncol produces the number of columns on data.frame and matrix but does not on time-series. For example: ncol(anscombe) results in 8 but ncol(AirPassengers) results in NULL. If you decide to use ncol, then you need to coerce each dataset to a data.frame by using as.data.frame.
indexing the character vector of the names of the datasets. You need to call a dataset, not its character name, to be able to use as.data.frame. One way of doing this is by using eval(parse(text=the_name)).
the way to store the result. You can use c() to combine the results but the datasets will be converted to vectors, no longer in their initial structures. I recommend using list to preserve the data frame structures of the datasets.
Here is one possible solution based on those considerations:
datasets <- c("ability.cov", "airmiles", "AirPassengers", "airquality", "anscombe", "attenu")
single_col_datasets <- vector('list', 1)
for (i in seq_along(datasets)){
if (ncol(as.data.frame(eval(parse(text = datasets[i])))) == 1){
single_col_datasets[[i]] <- as.data.frame(eval(parse(text = datasets[i])))
names(single_col_datasets[[i]]) <- datasets[i]
}
not.null.element <- single_col_datasets[lengths(single_col_datasets) != 0]
new.datasets <- list(not.null.element, datasets)
}
Here is the result:
new.datasets
[[1]]
[[1]][[1]]
airmiles
1 412
2 480
3 683
4 1052
5 1385
6 1418
7 1634
8 2178
9 3362
10 5948
11 6109
12 5981
13 6753
14 8003
15 10566
16 12528
17 14760
18 16769
19 19819
20 22362
21 25340
22 25343
23 29269
24 30514
[[1]][[2]]
AirPassengers
1 112
2 118
3 132
4 129
5 121
6 135
7 148
8 148
9 136
10 119
11 104
12 118
13 115
14 126
15 141
16 135
17 125
18 149
19 170
20 170
21 158
22 133
23 114
24 140
25 145
26 150
27 178
28 163
29 172
30 178
31 199
32 199
33 184
34 162
35 146
36 166
37 171
38 180
39 193
40 181
41 183
42 218
43 230
44 242
45 209
46 191
47 172
48 194
49 196
50 196
51 236
52 235
53 229
54 243
55 264
56 272
57 237
58 211
59 180
60 201
61 204
62 188
63 235
64 227
65 234
66 264
67 302
68 293
69 259
70 229
71 203
72 229
73 242
74 233
75 267
76 269
77 270
78 315
79 364
80 347
81 312
82 274
83 237
84 278
85 284
86 277
87 317
88 313
89 318
90 374
91 413
92 405
93 355
94 306
95 271
96 306
97 315
98 301
99 356
100 348
101 355
102 422
103 465
104 467
105 404
106 347
107 305
108 336
109 340
110 318
111 362
112 348
113 363
114 435
115 491
116 505
117 404
118 359
119 310
120 337
121 360
122 342
123 406
124 396
125 420
126 472
127 548
128 559
129 463
130 407
131 362
132 405
133 417
134 391
135 419
136 461
137 472
138 535
139 622
140 606
141 508
142 461
143 390
144 432
[[2]]
[1] "ability.cov" "airmiles" "AirPassengers" "airquality" "anscombe" "attenu"
You can use the get function:
for (i in datasets){
if (ncol(get(i))==1){
dataset <- i
datasets <- c(dataset, datasets)
}
}
The function ludridate::yday returns the day of the year as an integer:
> lubridate::yday("2020-07-01")
[1] 183
I would like to be able to calculate the day of the year assuming a different yearly start date. For example, I would like to start all years on July 1st (07-01), such that I could call:
> lubridate::yday("2020-07-01", start = "2020-07-01")
[1] 1
I could call :
> lubridate::yday("2020-07-01") - lubridate::yday("2020-06-30")
[1] 1
But not only this would fail to account for leap years, it would be difficult to account for a date with a 2021 year (or any date that crosses the January 1st threshold for any given year):
> lubridate::yday("2021-01-01") - lubridate::yday("2020-06-30")
[1] -181
After working a little bit with this on my own, this is what I have created:
valiDATE <- function(date) {
stopifnot(`date must take the form of "MM-DD"` = stringr::str_detect(date, "^\\d{2}-\\d{2}$"))
}
days <- function(x, end = "06-30") {
valiDATE(end)
calcdiff <- function(x) {
endx <- glue::glue("{lubridate::year(x)}-{end}")
if(lubridate::yday(x) > lubridate::yday(endx)) {
diff <- ceiling(difftime(x, endx, units = "days"))
} else {
endx <- glue::glue("{lubridate::year(x)-1}-{end}")
diff <- ceiling(difftime(x, endx, units = "days"))
}
unclass(diff)
}
purrr::map_dbl(x, calcdiff)
}
day_vec <- seq(as.Date("2020-07-01"), as.Date("2021-06-30"), by = "days")
days(day_vec)
[1] 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 32 33 34 35 36 37
[38] 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
[75] 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
[112] 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
[149] 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185
[186] 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222
[223] 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259
[260] 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296
[297] 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
[334] 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365
I would still like to see other solutions. Thanks!
Adding or subtracting months from your date to the desired start of the year can be helpful in this case.
For your example vector of dates day_vec, you can subtract six months from all the dates if you want to start your year on July 1.
day_vec <- seq(as.Date("2020-07-01"), as.Date("2021-06-30"), by = "days")
day_vec2 <- day_vec %m-% months(6) #Substracting because the new year will start 6 months later
yday(day_vec2) #Result is similar to what you desired.
The point to keep in mind is whether your new beginning of the year is before or after the conventional beginning. If your year starts early, you should add months and vice-versa.
I am trying to creating a training dataframe for fitting my model. The dataframe I am working with is a nested dataframe. Using createDataPartition , I have created a list of indexes. But I am having trouble subsetting the dataframe with said list.
Here is what the object partitionindex created by caret::createDataParition looks like:
partitionindex
[[1]]
[[1]]$Resample1
[1] 4 5 6 8 9 10 11 12 14 15 17 18 20 21 23 28 30 32 34 38 39 41 42 46
[25] 47 48 50 52 53 56 57 58 59 60 64 66 67 70 73 75 76 77 78 82 85 87 90 95
[49] 97 99 105 106 110 113 114 116 117 118 119 120 123 124 126 128 129 130 132 134 135 137 139 141
[73] 142 143 144 145 146 148 149 151 153 154 155 157 158 164 165 167 170 174 176 178 182 183 184 186
[97] 189 190 191 193 194 197 198 200 201 202 203 206 210 211 212 213 214 216 219 221 222 223 226 232
[121] 236 237 241 243 247 248 251 254 255 256 258 262 263 264 269 270 271 274 276 277 280 281 284 291
[145] 292 293 295 296 297 299 300 301 302 303 304 309 314 317 318 319 320 323 324 327 328 329 339 341
[169] 342 343 344 345 349 350 351 353 354 355 356 360 361 363 364 365 367 370 371 375 379 380
[[2]]
[[2]]$Resample1
[1] 1 2 4 5 7 8 9 10 14 17 19 22 24 26 28 29 31 32 34 36 37 42 44 45
[25] 47 48 49 51 52 53 56 58 65 66 67 68 72 74 75 77 78 81 83 86 95 96 98 100
[49] 102 104 105 106 110 113 114 115 118 119 122 123 124 125 128 129 130 132 135 137 142 144 145 147
[73] 149 150 151 152 158 160 161 163 165 168 169 170 171 175 176 180 183 186 187 188 191 194 196 199
[97] 203 205 206 207 208 209 210 211 213 215 218 220 221 222 224 225 227 228 231 233 240 241 242 243
[121] 247 248 250 251 254 255 256 257 258 262 263 264 267 268 269 270 272 273 277 278 282 285 286 288
[145] 289 290 292 293 294 295 296 300 301 302 304 305 307 308 312 314 315 316 317 321 323 328 329 332
[169] 333 335 336 339 341 343 344 345 347 348 349 354 355 359 360 362 363 366 369 374 375 376 377
[[3]]
[[3]]$Resample1
[1] 5 8 10 12 17 22 25 26 27 30 32 33 34 36 38 39 42 44 45 46 47 51 52 57
[25] 58 59 62 64 66 70 71 73 75 78 81 82 83 84 86 89 90 95 96 97 98 100 103 104
[49] 105 108 109 111 112 113 114 117 119 120 121 123 124 127 130 131 132 133 137 139 140 141 144 148
[73] 149 150 151 153 154 155 156 157 159 160 163 164 167 168 170 172 173 176 178 179 181 182 184 186
[97] 187 188 189 190 191 207 208 212 214 215 219 220 222 223 227 230 233 234 238 248 250 251 252 253
[121] 256 258 260 261 262 264 265 266 267 270 271 272 275 278 281 285 288 289 291 293 295 297 298 302
[145] 303 305 306 308 312 314 315 318 319 320 321 323 325 326 329 332 333 334 335 336 338 342 343 345
[169] 347 348 349 350 351 352 360 361 363 364 365 366 368 369 370 371 372 374 375 376 377 378
[[4]]
[[4]]$Resample1
[1] 1 2 3 4 5 6 7 8 10 12 14 15 18 19 20 22 23 25 26 27 28 30 31 34
[25] 37 38 40 44 45 46 47 49 50 51 52 59 62 64 66 68 70 71 72 73 75 76 79 80
[49] 81 83 84 86 88 89 91 92 94 95 96 97 99 100 102 105 108 109 112 119 125 126 129 130
[73] 132 134 137 139 140 141 145 150 153 155 156 158 159 162 163 170 178 179 181 182 184 185 187 188
[97] 190 191 192 194 196 197 199 201 205 206 207 218 219 220 223 229 230 231 232 237 238 240 241 242
[121] 244 245 247 248 249 251 252 253 257 258 260 261 263 264 265 266 270 271 273 275 276 283 285 289
[145] 290 291 294 298 299 300 302 303 304 306 307
And the nested dataframe:
> nested_df
# A tibble: 4 x 2
# Groups: League [4]
League data
<chr> <list<df[,133]>>
1 F1 [380 x 133]
2 E0 [380 x 133]
3 SP1 [380 x 133]
4 D1 [308 x 133]
I tried something like this but to no avail:
nested_df%>%
mutate(train = data[map(data,~.x[partitionindex,])])
Error in x[i] : invalid subscript type 'list'
Is there a solution involving purrr::map or lappy?
I think this could work, with purrr::pmap
nested_df %>%
ungroup() %>% # make sure the table is not grouped
mutate(i = row_number()) %>%
mutate(train = pmap(
.,
function(data, i, ...) {
data[partitionindex[[i]]$Resample1,]
}
)) %>%
select(-i)
I have downloaded the historical stock prices of a list of 218 stocks. I want check whether it is populated with the the most recent date or not. I have written a function to that effect, by name check.date
function(snlq){
j <- 1;
for(i in 1:length(snlq)){
ind <- index(snlq[[i]])
if(identical(ind[length(ind)],"2018-05-04") == FALSE){
s[j] <- i
j <- j+1
}
}
return(s);
}
snlq is list of stocks with length 218 and of class list
But when I run it, I get the following output:
check.date(snlq)
[1] 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 32
[33] 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
[65] 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
[97] 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128
[129] 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
[161] 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192
[193] 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 356 358 359 360 361 362
[225] 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394
[257] 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
[289] 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458
[321] 459 460 461 462 463 464 465 466 467 468 469 470
How can the output be of length more than 218? Also I have checked that snlq[[1]] is up to date; then why is 1 in the output?
This might seem like a simple for loop problem, but is perplexing me.
Very many thanks for your time and effort...
It seems the problem is that s is not created in scope in which it is updated and used. #Dave2e has correctly pointed out in above comment. The most logical error seems to me is that s has been created in global space that's why your function is not giving error, otherwise your function would have not run.
There are many ways to fix the problem. One of the option can be as:
check.date <- function(snlq){
j <- 1;
ss <- integer() #declare before use in function scope
for(i in 1:length(snlq)){
ind <- index(snlq[[i]])
if(identical(ind[length(ind)],"2018-05-04") == FALSE){
s = c(s,j) #Kind of adding an element to vector s
j <- j+1
}
}
return(s);
}
I cannot check this result without a reproducible example, but I think this will simplify your function greatly.
check.data <- function(input, today) {
result <- sapply(input, function(x) {
ind <- index(x)
!identical(ind[length(ind)], today)
})
which(result)
}
So, I have this time series that tracks the daily number of applications to a graduate program. Each application period is 64 days - so for each period, you start at zero and it goes up until the end of the period. The last period is partial, representing the current application period.
[1] 0 26 32 36 37 38 40 43 43 44 45 45 45 45 49 49 55 61 66 69 73 77 85 94 99 102 104 108 113 117 123 126 128 132 138 143 151 156 158 161 162 172 175 179 182 189 193
[48] 196 206 213 218 225 234 241 243 251 256 264 267 273 277 282 290 302 0 16 23 36 40 44 51 54 58 60 64 66 69 74 82 88 90 91 92 93 96 102 102 104 106 109 111 115 117 124
[95] 124 126 128 128 129 130 132 135 135 136 139 140 146 150 152 155 157 159 160 167 171 173 174 174 176 177 180 182 184 185 186 186 187 187 0 11 16 27 38 40 44 51 54 57 61 71 80
[142] 85 92 95 97 100 107 116 121 125 131 134 134 136 137 143 150 151 156 163 163 165 173 189 200 210 215 233 247 256 275 279 284 291 304 310 315 325 330 332 332 343 345 351 357 359 359 365
[189] 371 372 372 374 0 24 34 41 53 65 74 78 84 90 93 96 104 105 112 118 122 126 134 138 143 151 155 156 158 159 164 171 177 180 184 188 196 201 203 218 223 225 230 233 236 240 245
[236] 250 255 259 265 267 275 281 285 290 293 298 307 316 319 320 322 325 328 338 342 342 0 10 18 23 27 40 51 60 67 71 73 76 82 88 91 94 102 102 104 111 114 118 119 123 123 130
[283] 133 142 146 154 157 160 163 172 177 187 192 195 195 197 201 208 210 214 222 225 227 232 240 243 246 249 251 254 258 261 265 267 269 270 272 274 293 293 0 12 17 19 22 27 28 32 35
[330] 38 44 45 45 46 52 54 55 61 67 73 77 79 82 85 87 90 110 122 128 133 145 157 169 179 198 205 215 229 239 256 264 279 290 298 306 309 317 322 324 327 331 341 357 375 379 382
[377] 385 395 396 398 400 407 409 415 0 57 72 94 104 119 125 129 131 136 149 154 165 173 177 181 186 191 195 204 210 216 224 234 240 245 253 257 263 269 273 276 283 287 304 322 328 332 352
[424] 366 377 380 383 387 388 398 405 408 411 416 420 427 435 437 446 448 455 463 468 476 486 493 501 501 0 17 35 48 61 69 77 87 95 100 105 109 112 117 120 122 125 131 136 141 145 154
[471] 159 161 164 169 172 179 182 190 192 199 203 206 209 218 225 228 231 237 241 243 245 248 249 256 262 277 289 295 303 308 313 321 330 333 334 342 343 344 346 349 353 354 1 17 32 40 48
[518] 50 53 54 55 56 62 65 69 73 75 81 85 87 89 92 96 98 100 103 106 108 111 112 113 121 123 127 130 136 136 141 143 146 146 150 151 152 153 154 164 175 184 187 189 191 192 193
[565] 198 203 217 220 230 234 237 240 244 256 262 268 0 20 31 46
Each day, I run a simple model that happens to predict the number of applications quite well.
myts2 <- ts(df, frequency = 64)
myts2 <- HoltWinters(myts2, seasonal = "additive")
fcast <- predict(myts2, n.ahead=60, prediction.interval = T, level = 0.95)
# Creates data frame with day (0 to 63), predicted fit, and confidence intervals
castout <- data.frame((elapsed):63, as.numeric(fcast[,1]), as.numeric(fcast[,2]), as.numeric(fcast[,3]))
names(castout) <- c("Day", "Total", "High", "Low")
# Simplified; this block ensures the low esimate cannot dip below the current number of applications
castout$Low[castout$Low < 53)] <- 53
Here's a graph of the results, and the output of fcast:
> fcast
Time Series:
Start = c(10, 5)
End = c(10, 64)
Frequency = 64
fit upr lwr
10.06250 51.08407 77.18901 24.979132
10.07812 55.25007 91.76327 18.736879
10.09375 61.69342 106.24630 17.140542
10.10938 65.36204 116.71089 14.013186
10.12500 69.29609 126.64110 11.951078
10.14062 71.76356 134.53454 8.992582
10.15625 76.06790 143.83176 8.304034
10.17188 78.42243 150.83574 6.009127
10.18750 81.85213 158.63385 5.070411
10.20312 86.70147 167.61610 5.786832
10.21875 94.62669 179.47316 9.780222
10.23438 101.18980 189.79380 12.585798
10.25000 104.27303 196.48157 12.064493
10.26562 106.00446 201.68183 10.327081
10.28125 107.74120 206.76598 8.716431
10.29688 109.56690 211.82956 7.304241
10.31250 112.75659 218.15771 7.355464
10.32812 119.17347 227.62227 10.724667
10.34375 120.76563 232.17877 9.352490
10.35938 123.42045 237.72108 9.119822
10.37500 126.19423 243.31117 9.077281
10.39062 130.27639 250.14350 10.409274
10.40625 133.92534 256.48092 11.369764
10.42188 138.90565 264.09197 13.719325
10.43750 142.15385 269.91676 14.390943
10.45312 149.87770 280.16626 19.589151
10.46875 152.03874 284.80490 19.272586
10.48438 155.52991 290.72828 20.331547
10.50000 143.70956 281.29715 6.121980
10.51562 144.86804 284.80405 4.932018
10.53125 150.57027 292.81595 8.324581
10.54688 156.17148 300.68993 11.653042
10.56250 162.91642 309.67243 16.160415
10.57812 167.96348 316.92344 19.003512
10.59375 170.24252 321.37431 19.110738
10.60938 173.24254 326.51538 19.969707
10.62500 173.89835 329.28274 18.513961
10.64062 181.92820 339.39583 24.460577
10.65625 185.62127 345.14493 26.097603
10.67188 188.82313 350.37666 27.269594
10.68750 191.58817 355.14638 28.029951
10.70312 197.56781 363.10643 32.029187
10.71875 201.46633 368.96194 33.970710
10.73438 203.75381 373.18381 34.323802
10.75000 211.86575 383.20831 40.523188
10.76562 218.58229 391.81629 45.348290
10.78125 223.19144 398.29645 48.086433
10.79688 229.36717 406.32341 52.410940
10.81250 237.59928 416.38758 58.810989
10.82812 244.59432 425.19609 63.992543
10.84375 247.02798 429.42520 64.630764
10.85938 253.22807 437.40324 69.052906
10.87500 258.46738 444.40349 72.531266
10.89062 265.76017 453.44071 78.079642
10.90625 268.82203 458.23093 79.413143
10.92188 274.29332 465.41494 83.171700
10.93750 278.46062 471.27976 85.641485
10.95312 283.35496 477.85680 88.853120
10.96875 290.67334 486.84344 94.503231
10.98438 301.22108 499.04539 103.396775
As you can see, the # of applications in a given cycle is either flat or increasing. Yet in the prediction, there's a dip just after day 30. For the life of me, I cannot figure out what is causing it. Any ideas?