STA5106_FRADE_HW10

STA5106_FRADE_HW10 - X(j) = -log(U(j)); else X(j) =...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
STA5106: Dr. Srivastava Homework 10 Jaime Frade 1. OUTPUT The estimated theta is for 1 0.0089 The estimated theta is for 2 0.0089 The estimated theta is for 3 0.0089 The estimated theta is for 4 0.0089 The estimated theta is for 5 0.0089
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STA5106: Dr. Srivastava Homework 10 Jaime Frade CODE clear all close all clc for i=1:5 eps=1; n=1; t=5; a=i; while (eps>10^(-9)) x2_i(n) = randn+t; w2_i(n) = exp(-a*(abs(x2_i(n)-a)+a)); thetaN_2(n) = (1/2)*exp(a^2/2)*mean(w2_i'); if (n==1) eps=1; else eps=abs(var(thetaN_2(1:n)')-var(thetaN_2(1:n-1)')); end ; n=n+1; end ; disp( 'The esitmated theta is for' ); disp(a); disp(thetaN_2(end)); end
Background image of page 2
STA5106: Dr. Srivastava Homework 10 Jaime Frade 2. OUTPUT 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 5 1.25 1.3 1.35 1.4 1.45 1.5 1.55 1.6 1.65 Mean of function Mean of function 1.3337 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 5 1.5 2 2.5 3 3.5 Variance of function Variance of function 1.7825 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 10 5 6 7 8 9 10 11 12 Kurtosis of function Kurtosis of function 9.3061
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
STA5106: Dr. Srivastava Homework 10 Jaime Frade CODE clear all close all clc N=200000; U_1 = rand(1,N); U = rand(1,N); for j=1:N if U_1(j) > 0.5
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: X(j) = -log(U(j)); else X(j) = -log(U(j)); end end for i = 100:100:N index = i/100; mean_func(index) = sum(X(1:i).*exp(abs(X(1:i))-(3/4)*abs(X(1:i))))/sum(exp(abs(X(1:i))-(3/4)*abs(X(1:i)))); var_func(index) = sum(((X(1:i)-mean_func(index)).^2).*exp(abs(X(1:i))-(3/4)*abs(X(1:i))))/sum(exp(abs(X(1:i))-(3/4)*abs(X(1:i)))); Kurt_func(index) = sum((((X(1:i)-mean_func(index)).^4)/ ((var_func(index))^2)).*exp(abs(X(1:i))-(3/4)*abs(X(1:i))))/sum(exp(abs(X(1:i))-(3/4)*abs(X(1:i)))); end figure(1); plot(100:100:N, mean_func); title( 'Mean of function' ); disp( 'Mean of function' ); disp(num2str(mean_func(end))); figure(2); plot(100:100:N, var_func); title( 'Variance of function' ); disp( 'Variance of function' ); disp(num2str(var_func(end))); figure(3); plot(100:100:N, Kurt_func); title( 'Kurtosis of function' ); disp( 'Kurtosis of function' ); disp(num2str(Kurt_func(end)));...
View Full Document

This note was uploaded on 12/14/2011 for the course STAT 5106 taught by Professor Staff during the Fall '08 term at FSU.

Page1 / 4

STA5106_FRADE_HW10 - X(j) = -log(U(j)); else X(j) =...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online