Linear Regression with NaN Elements

조회 수: 3 (최근 30일)
Computer Lover
Computer Lover 2018년 1월 9일
답변: Birdman 2018년 1월 9일
Hi everbody,
I have a data set which is named as AA.
AA=[0.02 NaN NaN NaN 0.03 0.035 0.045 NaN NaN 0.05 0.059]
I should create a linear regression on NaN elements. (regression must be created from 0.02 to 0.03 and from 0.045 to 0.05 )
How can i done it?
Thanks.
  댓글 수: 2
Birdman
Birdman 2018년 1월 9일
With NaN elements or without?
Computer Lover
Computer Lover 2018년 1월 9일
New dataset mustn't include NaN elements. Regression values should replace NaN elements' locations.

댓글을 달려면 로그인하십시오.

답변 (1개)

Birdman
Birdman 2018년 1월 9일
Something like this?(replacing NaN values with the mean of array without including NaNs)
AA(isnan(AA))=mean(AA(~isnan(AA)))

카테고리

Help CenterFile Exchange에서 Linear Regression에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by