Cancelado

MATLAB-Fsolve program for non-linear equations(repost)

function []= Pareto_Project(n,params) % Parameter inputs:L, U,alpha,sigma] L = params(1); % lower limit U = params(2); % upper limit alpha = params(3); % exponent or power indices sigma=params(4); % specified variance model %-------------------------------------------------------------------------- z = rand(n,1); x =((L^(-a) - z.*(L^(-a) - U^(-a))).^(-1/a)); e=randn(n,3); %case 1 is for specified variance e1=e(:,1).*sigma; dataY1=x+e1 L=(-N/2*log(2*pi))-N*log(sigma)+N*log(a)-N*log(L^(-a)-U^(-a))+sum(log(integral[L,U](x^(-a-1)*exp[-0.5*((yj-x)./sigma)^2); where integral[L,U] is the integral from L to U of that given density function. options=optimset('Display','iter','MaxFunEvals',3e3,'MaxIter',3e3,'diagnostics','on','Algorithm','levenberg-marquardt'); % Option to display output [point fval exitflag]=fsolve ( AT (point)mypowerlawfun1(point,dataY1),point0,options); function F=mypowerlawfun1(point,dataY1) %system of partial derivatives with the unknown parameters of L , U , alpha %and sigma. L=point(1);U=point(2);a=point(3);sigma=point(4); z=dataY1; n=length(z); I1=zeros(n,1); EyL=zeros(n,1); EyU=zeros(n,1); I2=zeros(n,1); I3=zeros(n,1); for k=1:n I1(k)=quadl(AT integrand1,L,U,[],[],z(k),a, sigma); % Eyx=exp(-0.5*((z(j)-x)./sigma).^2); EyL(k)=exp(-0.5.*((z(k)-L)./sigma).^2); EyU(k)=exp(-0.5.*((z(k)-U)./sigma).^2); I2(k)=quadl(AT integrand2,L,U,[],[],z(k),a,sigma); I3(k)=quadl(AT integrand3,L,U,[],[],z(k),a,sigma); pL=EyL./I1; pAlp=I2./I1; pU=EyU./I1; pS=I3./I1; end

## Deliverables

1) All deliverables will be considered "work made for hire" under U.S. Copyright law. Employer will receive exclusive and complete copyrights to all work purchased. (No 3rd party components unless all copyright ramifications are explained AND AGREED TO by the employer on the site per the worker's Worker Legal Agreement).

To get the above program to fine tune the program so that it can estimate the parameters of alpha, sigma and L and U, given the data that is generated from the power law distribution. All source code shall be delivered to the employer THE "AT" above Should be replaced with the "SHIFT 2" symbol

## Platform

F=[((n*a*L^(-a-1))/(L^(-a)-U^(-a)))-(L^(-a-1))*sum(pL); ((-n*a*U^(-a-1))/(L^(-a)-U^(-a)))+(U^(-a-1))*sum(pU); (n/a)+(n/(L^(-a)-U^(-a)))*((U^(-a)*(log(U))-(L^(-a)*(log(L)))))+sum(pAlp); (-n/sigma)+(1/sigma^3)*sum(pS)]; y1=(x.^(-a-1)).*exp((-0.5).*((z-x)./sigma).^2); function y2=integrand2(x,z,a,sigma) y2=(x.^(-a-1)).*(log(x)).*exp((-0.5).*((z-x)./sigma).^2); function y3=integrand3(x,z,a,sigma) y3=(x.^(-a-1)).*((z-x).^2).*exp((-0.5).*((z-x)./sigma).^2); i have tested the function with y having 15 observations, that have been generated as power law distribution, where L=3, U=6, a=1.5 and sigma=0.4. dataY1=[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],[url removed, login to view],4.5607.

Habilidades: Matlab and Mathematica

Ver mais: source code matlab, program algorithm, equations work, employer power, case worker, alpha source, alpha hire, sum algorithm, matlab all, y3, variance, matlab program, matlab power system, matlab algorithm, linear, equations, mathematica function, power system matlab code, matlab randn, mathematica data, mathematica source code, non linear matlab, non system, randn, matlab worker

Acerca do Empregador:
( 7 comentários ) Windhoek, Namibia

ID do Projeto: #3056920