I am trying to solve the equation: a * ( x ^ c / b ^ c + 1 ) ^ (1/c) where a/b = constant
I can solve the equation but I don't know how to introduce the constraint a/b = constant (or alternatively ABS(constant - a/b) is minimized)
Would anyone be kind enough to set me on the right track here?
So far I have :
Code:
Public Sub function_ShrinkageFit_func(c As Double(), x As Double(), ByRef func As Double, obj As Object)
func = c(0) * ((((x(0) ^ c(2)) / (c(1) ^ c(2))) + 1) ^ (1 / c(2)))
End Sub
Public Function ShrinkageFit()
Dim x(,) As Double
Dim y() As Double
Dim c() As Double = New Double() {1, 1, 10}
Dim bndl() As Double = New Double() {0.0, 0.0, 0.0}
Dim bndu() As Double = New Double() {Double.PositiveInfinity, Double.PositiveInfinity, 50.0}
Dim epsf As Double = 0
Dim epsx As Double = 0.000001
Dim maxits As Integer = 0
Dim info As Integer
Dim state As alglib.lsfitstate = New alglib.lsfitstate()
Dim rep As alglib.lsfitreport = New alglib.lsfitreport()
Dim diffstep As Double = 0.0001
... fill x and y
alglib.lsfitcreatef(x, y, c, diffstep, state)
alglib.lsfitsetbc(state, bndl, bndu)
alglib.lsfitsetcond(state, epsf, epsx, maxits)
alglib.lsfitfit(state, AddressOf function_ShrinkageFit_func, Nothing, Nothing)
alglib.lsfitresults(state, info, c, rep)
Thanks,
Michael