Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
方程式 y を最小化する x の値を取得しようとしています。Rを使いたい。
方程式は次のとおりです。
y= [(a-bx)^2] / {[2bx /(1+x)]+c} ここで、a、b、c はすべて一定ですが、互いに異なります。
y= [(a-bx)^2] / {[2bx /(1+x)]+c}
ありがとう。
単純な 1 次元の最小化には、標準の最適化関数で十分です。
a <- 2 b <- 1 c <-1 func <- function(x){(a-b*x)^2/((2*b*x/(1+x))+c)} optimize(f=func, interval = c(-3,3))
$minimum [1] -0.3333377
$objective [1] -277201.4