用matlab画大数据曲线_大数据分析 MATLAB 篇

论坛 期权论坛 编程之家     
选择匿名的用户   2021-5-29 15:36   11   0

本篇教程介绍了大数据分析 MATLAB 篇,希望阅读本篇文章以后大家有所收获,帮助大家对大数据云计算大数据分析的理解更加深入。

<

一:起因

(1)最近一直在处理大数据,从MB ----> GB的变化,是一次质的飞跃,相应的工具也在变 从widows到linux,从单机单核 到 hadoop多节点的计算

(2)问题来了,面对海量的数据,如何从中挖掘实用的信息或者发现潜在的现象,可视化工具可能是必不可少的 ;

(3)可视化工具可以说百度一大篇,可是作为研究者的我们,程序猿的我们可能更希望能够抽象出一种数学模型,对现实的现象进行非常好的描述和刻画

(4)Python(数据清洗和处理) + MATLAB(模型分析) 或 c++/java/hadoop(数据清洗和处理) + MATLAB(模型分析)

二:MATLAB 学习

(1)伽马分布(gamfit)

clc

clear all

close all

dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');

data = dataall(:,3);%指定列

[y,x]=hist(data,6);%creates a histogram bar plot of data,sorts data into the number of bins specified by nbins

%return the categorical levels correponding to each count in N

subplot(2,2,1)

bar(x,y,'FaceColor','r','EdgeColor','w');box off

cxd1=gamfit(data);% returns the maximum likehood estimates(MLEs) for the parameters of the gamma distribution given the data in vector data.

% 伽玛分布中的参数α,称为形状参数,β称为尺度参数。

a = cxd1(1);

b = cxd1(2);

cxd2=gamcdf(data,cxd1(1),cxd1(2));%return the gamma cdf(分布函数) at each of the values in x using the corresponding shape parameters a and scale parameter

%cxd2 = gampdf(data,cxd1(1),cxd1(2));%%return the gamma pdf(密度函数) at each of the values in x using the corresponding shape parameters a and scale parameter

H=kstest(data,[data,cxd2]);

subplot(2,2,2);

plot(data,cxd2);

(2)MATALAB 下 .m 文件的命名

% 错误提示:

%Attempt to execute SCRIPT *** as a function 在运行MATLAB程序的时候,出现如题的报错。

% 原因:

% 在系统中,现有的.m文件有的与***函数重名,所以matlab编译器不知道在遇到***的时候到底该执行哪一个函数。

% 例如:我编写了一个.m文件,命名为:fft2.m.用于实现通过频域分析提取图像的纹理特征。

% 当命令执行到X=fft2(ImageM)这句话的时候,不知道fft2是指系统函数还是自定义的纹理特征提取函数。

% 解决:

% 把自定义的函数名改成其他名字。如上例中的fft2改为ffttexture.m?

(3)pdf 和 cdf函数的说明、

Probability density function(PDF) 概率密度函数;

cumulative distribution function ; CDF 是累积分布函数

(4)正态分布(normpdf normcdf)

clc

clear all

close all

dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');

data = dataall(:,3);%指定列

[mu,sigma]=normfit(data);%estimate of the mean and standard deviation in data

[y,x]=hist(data,6);%creates a histogram bar plot of data,sorts data into the number of bins specified by nbins

%return the categorical levels correponding to each count in N

bar(x,y,'FaceColor','r','EdgeColor','w');box off

xlim([mu-3*sigma,mu+3*sigma]) % sets the axis limits in the current axes to the specified values

a2=axes;

% computes the pdf at each of the values in X using the normal distribution

% with mean and standard deviation sigma.

ezplot(@(x)normpdf(x,mu,sigma),[mu-3*sigma,mu+3*sigma])

set(a2,'box','off','yaxislocation','right','color','none')

title '频数直方图与正态分布密度函数(拟合)'

(5) quantile - quantile plot (Q-Q plot)

clc

clear all

close all

dataall = load('G:\zyp_thanks\metro_test\1-07\529_2.csv');

data = dataall(:,3);%指定列

qqplot(data);

% displays a quantile-quantile plot of the sample quantiles of X versus

% theoretical from a normal distribution. if the distribution of X is

% normal,the plot will be close to linear.

本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标大数据云计算大数据分析频道!

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP