dphfwzn8269 2019-02-21 17:17
浏览 125

检查功能点的位置


I have a points and I want to draw a best fit hyperbolic function for this points.
Now I want to make a Quality checker. Any ideas?
My idea was to check where is the point against the function. ( Like if the point is over / under or on the function )
prescription function is : fn(x)=A1+(A2/A3*(x+A4))
My first idea for this was:

function checkQuality($points,$m,$k,$A1,$A4){
    $over = 0;
    $under= 0;
    $on = 0;
    $radius = 3;

    foreach ($points as $point){
        $status = ($A1+($m/($k*($point['x']+$A4)))-$point['y']);
        if($status < $radius && $status > -$radius){
            $status = 0;
        }
        if($status > 0){
            $over++;
        }else if($status <1 && $status >= 0){
            $on++;
        }else if($status < 0){
            $under++;

        }
    }
    if($under < $over){
        $percentChange = ($under !== 0 ? ($under / $over) : 0) * 100;
    }else{
        $percentChange = ($over !== 0 ? ($over / $under) : 0) * 100;
    }

    return ['on'=>$on,'over'=>$over,'under'=>$under,'percent'=>$percentChange];
}

But the result is not so accurate.

Here I post how its look like. The green curve is manualy set and the blue one is generated ( Where I'm using the quality check for check how is good and if is bad try generate better curve ) -> the Green curve is better than the blue

Graph screen

(The values in the inputs are for green curve)


here is code where I'm using the Quality check for imagine why I want to have the most possible accurate checker:

  for($i = 0; $i < 10000 ; $i++){
        $new_m += 0.2;
        $actual = $this->checkQuality($points['points'],$new_m,$ob['k'],0,0);
        if($actual['percent'] > $prev['percent']){
            $prev['percent'] = $actual['percent'];
            $prev['m'] = $new_m;
            $newQuality = $actual;
        }else if($i>0 && $actual['percent'] < $prev['percent']){
            break;
        }
    }
  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作
    • ¥15 求NPF226060磁芯的详细资料