拟合列表的线性组合

时间:2018-09-20 13:20:36

标签: python signal-processing

我有以下期望方程,它期望在多个温度下产生应变

public function store(Request $request)
    {
       $rules = [
           'description' => 'min:4',
           'image' => 'required|image|mimes:jpg,jpeg,png',
           'choose-category' => 'array|required'
           ];

        $messages = [
            'description.min' => 'Название должно содержать минимум :min символа.',
            'image.required' => 'Изображение загружать обязательно.',
            'image.image' => 'Вы загрузили не изображение.',
            'image.mimes' => 'Допустимые форматы: jpg, jpeg, png.',
            'choose-category.required' => 'Выберите категорию'
         ];

        Validator::make(
            $request->all(),
            $rules ,
            $messages
              )->validate();

      $image = $request->file('image');

      $description = $request->input('description');

      $this->imageClass->add($image, $description);

      $this->imageClass->save();

      $idNewImage = $this->imageClass->id;
      $categories = $request->input('choose-category');

      $relation = \App\Services\Image::find($idNewImage);

      $relation->categories()->attach($categories);

      //$this->imageClass->addRelation($categories, $idNewImage);

      return redirect('/');
    }

我将其定义为

E(Y) = c + Sum ai*ti  i=1 to n

我使用以下最小二乘

def residuals(params, xData, yData ):
    expecation = params[-1] + np.zeros(1)
    for j in range (2):
        for i in range(len(xData)):
            expecation += params[i]*xData[j][i]
    diff = expecation - yData
    return diff

我想知道如何使用系数来获得预期的应变并将其绘制出来。

0 个答案:

没有答案