Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ltv = [ 3 5 4 , 1 8 1 , 2 8 3 , 1 0 7 ] conv _ rate = [ 0
ltv
convrate
def estimateoptimalbidsalphabeta, ltv convrate:
alpha, beta alphabeta
x npzeros
params npconcatenatexalpha beta ltv convrate
bounds NoneNone NoneNone None None
result minimizeobjective params boundsbounds
optimalbids result.x:
return optimalbids
alphabetakw
optimalbidskw estimateoptimalbidsalphabetakw ltv convrate
printkw optimal bids: optimalbidskw
ValueError Traceback most recent call last
varfolderspvwvlxkvnsrgvlhgnTipykernelpy in
alphabetakw
optimalbidskw estimateoptimalbidsalphabetakw ltv convrate
printkw optimal bids: optimalbidskw
varfolderspvwvlxkvnsrgvlhgnTipykernelpy in estimateoptimalbidsalphabeta, ltv convrate
params npconcatenatexalpha beta ltv convrate
bounds NoneNone NoneNone None None
result minimizeobjective params boundsbounds
optimalbids result.x:
return optimalbids
~optanacondalibpythonsitepackagesscipyoptimizeminimize.py in minimizefun x args, method, jac, hess, hessp, bounds, constraints, tol, callback, options
if callablejac:
jac removefromfuncjac ifixed, xfixed, remove
# make a copy of the constraints so the user's version doesn't
# get changed. Shallow copy is ok
~optanacondalibpythonsitepackagesscipyoptimizeminimize.py in standardizeboundsbounds x meth
res minimizescalarboundedfun bounds, args, options
elif meth 'golden':
res recoverfrombracketerrorminimizescalargolden,
fun, bracket, args, options
else:
~optanacondalibpythonsitepackagesscipyoptimizeconstraints.py in newboundstooldlb ub n
excesslb npmaximumselfbounds ev
excessub npmaximumev self.bounds
return excesslb excessub
~optanacondalibpythonsitepackagesnumpycoreoverridespy in broadcasttoargskwargs
~optanacondalibpythonsitepackagesnumpylibstridetricks.py in broadcasttoarray shape, subok
return broadcasttoarray shape, suboksubok, readonlyTrue
~optanacondalibpythonsitepackagesnumpylibstridetricks.py in broadcasttoarray shape, subok, readonly
'negative'
extras
it npnditer
array flagsmultiindex', 'refsok 'zerosizeok extras,
opflagsreadonly itershapeshape, orderC
ValueError: operands could not be broadcast together with remapped shapes originalremapped: and requested shape
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started