[英]How to invert the estimate of a function with multiple inputs, but only invert the function for a single input
我正在嘗試反轉 function,就像反轉經驗 cdf 一樣。 如果我想反轉經驗 cdf,我會寫類似的東西,
tau = 0.8
y=rnorm(1000,1)
[f,x]=ecdf(y)
q = interp1(f,x,tau,'next');
相反,假設我定義了一個具有多個輸入的 function,其中除最后一個輸入外的所有輸入都基於數據。 例如,
example_data= example_data_missingdatacdf(x1,x2,x3,scalar_delta)
我想找到 delta 的最小值,這樣
example_data_missingdatacdf(x1,x2,x3,scalar_delta)>= tau
我能做什么? 感謝您提前提供幫助。
您會找到example_data_missingdatacdf(x1,x2,x3,scalar_delta) - tau = 0
的scalar_delta
值。 假設function單調遞增,這是滿足你要求的最小值。
有標准的數值技術可以找到 function 的過零點。MATLAB 在fzero
中實現了這種技術。
這就是您使用它的方式:
fun = @(d) example_data_missingdatacdf(x1,x2,x3,d) - tau;
scalar_delta = fzero(fun, 0);
0 是算法的起點,您最好的猜測。 鑒於 function 是單調的,猜得好並不重要,你總會找到唯一的零。 但是一個好的猜測會讓算法收斂得更快。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.