Question:
Determine The Probability Density Function For The Following Cumulative Distribution Function.
Use this Website: https://drive.google.com/file/d/1FmcXlipfxYqiXFOSWql6G7vJ4llu0N5O/view?usp=sharing
Need the codes for MATHLab
Note:
->> Need the right codes for the App Called MathLab, use the codes to get the answer.
"f_x(x; \\sigma^2)= \\frac{1}{\\sqrt{2 \\pi \\sigma^2}} e^{-\\frac{x^2}{2 \\sigma^2}}"
By factorization theorem , we can write it as
"=g(\\sum_i^n x_i^2 \\sigma^2)*h(x)"
Therefore
"T=\\sum_1^n x_i^2" is sufficient statistic for "\\sigma^2" where "h(x)=1"
% Clearing Screen
clc
% Setting x as symbolic variable
syms x;
% Input Section
y = input('Enter non-linear equations: ');
a = input('Enter initial guess: ');
e = input('Tolerable error: ');
N = input('Enter maximum number of steps: ');
% Initializing step counter
step = 1;
% Finding derivate of given function
g = diff(y,x);
% Finding Functional Value
fa = eval(subs(y,x,a));
while abs(fa)> e
fa = eval(subs(y,x,a));
ga = eval(subs(g,x,a));
if ga == 0
disp('Division by zero.');
break;
end
b = a - fa/ga;
fprintf('step=%d\ta=%f\tf(a)=%f\n',step,a,fa);
a = b;
if step>N
disp('Not convergent');
break;
end
step = step + 1;
end
fprintf('Root is %f\n', a);
Comments
Leave a comment