Satatistical program for variancy

源代码在线查看: stat2.m

软件大小: 6 K
上传用户: myc
关键词: Satatistical variancy program for
下载地址: 免注册下载 普通下载 VIP

相关代码

				clear;clc;
				
				N=10000;
				a = -3.;
				b=3.;
				W = 0.01;
				X = randn(1,N);
				Y = X.^2;
				N = length(Y)
				%prog=(a:W:b);
				prog2=(a:W:b);
				[nr nc] = size(prog2);
				
				for i1=1:nc
				    ref(i1)=(1./(sqrt(2*pi*prog2(i1))))*exp((-prog2(i1))/(2));
				    K=find(Y > prog2(i1));
				    kc = length(K);
				    F(i1)=kc;
				end
				
				for i1=1:nc-1
				    p(i1)=(F(i1)-F(i1 + 1))/(N*W);
				end
				
				prog1=prog2(1:nc-1);
				plot(prog1,p,'r*',prog2,ref,'g')
				
							

相关资源