The dataset should have one more column than the predictors and response. This additional column, which is typically a date or day number, has to be named "date" or "day"

build_model(c0, history_window, penalty_factor = 15, start = 10,
  initial_expiry_data = c(0, 0), initial_collection_data = c(60, 60,
  60), data, date_column = "day|date", response_column = "plt_used",
  show_progress = TRUE)

Arguments

c0

the c0 value

history_window

Number of days to look back

penalty_factor

penalty for shortage specified by doctors

start

the day the model is evaluated??. Default 10

initial_expiry_data

the number of units expiring in an day and the day after, a 2-length vector

initial_collection_data

is the number of units that will be collected for the first three days when the prediction begins

data

the dataset

date_column

the name of the date or day number column as a regex, default is "day|date" i.e. day or date

response_column

the name of the response column, default is "plt_used"

show_progress

a TRUE/FALSE flag for showing progress, default TRUE

Examples

build_model(c0 = 30, history_window = 200, penalty_factor = 15, start = 10, response_column = "plt.used", data = day3_data, show_progress = FALSE)
#> $lambda #> [1] 38 #> #> $w #> [1] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 #> [26] 8 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 2 7 0 0 0 0 0 #> [51] 6 12 10 0 0 0 0 0 2 11 0 0 0 0 0 0 0 0 0 3 12 7 6 0 0 #> [76] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [101] 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 #> [126] 0 0 0 0 0 0 0 0 0 0 12 7 0 0 0 0 0 0 0 0 2 16 0 0 0 #> [151] 0 0 5 1 0 0 8 5 0 0 0 0 0 1 13 0 0 0 0 0 0 0 0 0 0 #> [176] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 2 #> #> $r #> [1] 0 0 0 0 0 0 0 0 0 1 0 0 69 49 38 28 50 62 60 68 59 52 50 69 59 #> [26] 59 40 43 38 29 33 45 49 55 57 52 41 47 58 59 62 57 63 62 73 55 21 28 38 72 #> [51] 71 57 50 45 53 69 54 56 59 59 58 59 77 69 54 52 59 68 78 80 63 52 54 67 32 #> [76] 34 30 35 28 43 34 44 33 38 26 28 51 77 50 44 14 28 18 36 39 29 25 40 31 40 #> [101] 52 70 55 51 33 49 46 63 76 54 59 47 52 40 39 43 44 48 56 46 37 51 58 57 38 #> [126] 49 42 39 43 58 51 66 62 71 65 58 67 55 64 55 45 22 45 68 64 60 55 52 38 47 #> [151] 66 64 61 53 62 68 62 63 36 45 54 58 49 56 66 38 31 23 34 36 46 54 43 46 42 #> [176] 55 50 50 54 55 59 52 71 56 50 58 57 76 66 63 58 54 52 50 33 40 40 51 52 59 #> #> $first_day_waste_seen #> [1] 15 #> #> $coefs #> intercept M T #> 1.555782e+02 2.287581e+00 1.024150e+00 #> W Th F #> 1.133940e+00 4.802359e-01 -8.017546e-01 #> S Sn seven_lag #> -3.665886e+00 -4.582665e-01 2.667607e+00 #> PLTlow WBChigh RBClow #> -1.149610e+00 0.000000e+00 4.501233e+00 #> HGBlow MCVlow MCHlow #> -4.127732e+00 5.218051e+00 1.353588e-01 #> MCHClow RDW ALYM #> -1.431865e-13 -5.157767e+00 -1.608756e-13 #> B1 B2 B3 #> 4.846276e-01 -1.287047e+00 1.136636e+00 #> C1 C2 C3 #> 1.895563e-01 1.661915e-13 -8.078953e-01 #> CAPR.XFER.OVERFL CATH.PACU CDU.CLIN.DEC.UNIT #> 0.000000e+00 -4.012861e-01 5.995916e-01 #> D1CC D1CS D2 #> -1.019501e+00 -1.324502e-01 -1.240253e+00 #> D3 DGR E1 #> -4.292617e-01 -1.051047e+00 3.014380e-01 #> E2.ICU E29.ICU E3 #> -1.486079e-01 -1.333823e+00 -7.763748e-01 #> EMERGENCY.DEPARTMENT F3 FGR #> 3.535806e-01 9.287347e-02 2.682071e-02 #> G1 G2P G2S #> -1.734563e+00 -3.930774e-01 -2.595170e-01 #> H1 H2 #> 1.288267e+00 -2.222153e+00 #>