matlab canoncorr函数,Canonical correlation

使用MATLAB的canoncorr函数对汽车样本数据进行典型相关性分析。数据集中包含1970年至1982年406辆汽车的测量值。通过计算得到车辆的典型变量组合,展示X(位移、马力、重量)和Y(加速度、MPG)之间的相关性,并绘制了典型变量的散点图。
摘要由CSDN通过智能技术生成

Perform canonical correlation analysis for a sample data set.

The data set carbig contains measurements for 406 cars from the years 1970 to 1982.

Load the sample data.

load carbig;

data = [Displacement Horsepower Weight Acceleration MPG];

Define X as the matrix of displacement, horsepower, and weight observations, and Y as the matrix of acceleration and MPG observations. Omit rows with insufficient data.

nans = sum(isnan(data),2) > 0;

X = data(~nans,1:3);

Y = data(~nans,4:5);

Compute the sample canonical correlation.

[A,B,r,U,V] = canoncorr(X,Y);

View the output of A to determine the linear combinations of displacement, horsepower, and weight that make up the canonical variables of X.

A

A = 3×2

0.0025 0.0048

0.0202 0.0409

-0.0000 -0.0027

A(3,1) is displayed as —0.000 because

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值