Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Exercise 3: Write the following matlab code in R. mleThetaSgmaHat = zeros(m,2); for g = 1:m gThCol = yDataMatrix(:,g); gThCD = gThCol(gThCol < c.*R); mu1YHatMLE

Exercise 3: Write the following matlab code in R.

mleThetaSgmaHat = zeros(m,2);

for g = 1:m

gThCol = yDataMatrix(:,g);

gThCD = gThCol(gThCol < c.*R);

mu1YHatMLE = mean(gThCD); mu2YHatMLE = mean(gThCD.^2);

muYHatMLE = [mu1YHatMLE mu2YHatMLE];

n1Y = length(gThCD); n2Y = n-n1Y;

sigma0MLE = sqrt((mu2YHatMLE./c.^2) - (mu1YHatMLE./c).^2);

tz0MLE = -(mu1YHatMLE./(c.*sigma0MLE));

xStartMLE = [tz0MLE sigma0MLE];

PymtYMLEobjFun = @(x)PymtYMLEEqns(x,n,n1Y,n2Y,c,muYHatMLE,R);

PymtYMLESol = fsolve(PymtYMLEobjFun, xStartMLE, opt);

thetaHatYMLE = t-PymtYMLESol(2).*PymtYMLESol(1);

sigmaHatYMLE = PymtYMLESol(2);

mleThetaSgmaHat(g,:) = [thetaHatYMLE sigmaHatYMLE];

%waitbar(g/(2*m));

end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Time Series Databases New Ways To Store And Access Data

Authors: Ted Dunning, Ellen Friedman

1st Edition

1491914726, 978-1491914724

More Books

Students also viewed these Databases questions

Question

What is prove by contradictionand give a counter example.

Answered: 1 week ago