using LinearAlgebra, Random, Statistics
include("model.jl")
# The common case: bidding never switched off, branded spend entered as a channel
ols(y, cols...) = hcat(ones(length(y)), cols...) \ y
Random.seed!(3)
R = reduce(hcat, [begin d = simulate(156; holdout = 0); ols(d.sales, d.tv, d.social, d.brand)[2:4] end for _ in 1:2000])
println("no holdout, sales ~ TV + social + brand: ", round.(vec(mean(R, dims = 2)), digits = 2), " sd ", round.(vec(std(R, dims = 2)), digits = 2))
println("incremental sales per euro of branded spend: ", round(v * (share_paid.on + share_org.on - share_org.off) / (share_paid.on * cpc), digits = 2))
