STA5107_FRADE_HW7 - STA5107 Dr Srivastava Homework 7 Jaime...

This preview shows pages 1–6. Sign up to view the full content.

STA5107: Dr. Srivastava Homework 7 Jaime Frade 1. OUTPUT a) Plot f(x) over the interval [-4,10] b) f(x) = exp(-1/2*a^2)+2*exp(-1/2*(a-3)^2)+exp(-1/2*(a-6)^2) f’(x) = -a*exp(-1/2*a^2)+2*(-a+3)*exp(-1/2*(a-3)^2)+(-a+6)*exp(-1/2*(a-6)^2) c) See code

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

View Full Document
STA5107: Dr. Srivastava Homework 7 Jaime Frade d)
STA5107: Dr. Srivastava Homework 7 Jaime Frade

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

View Full Document
STA5107: Dr. Srivastava Homework 7 Jaime Frade
STA5107: Dr. Srivastava Homework 7 Jaime Frade CODE %part a and part b clear all ; clc; close all % Part (a) x=[-4:0.1:10]; for i=1:length(x) Fx(i)=exp(-x(i).^2/2)+2*exp(-(x(i)-3).^2/2)+exp(-(x(i)-6).^2/2); end plot(x,Fx) % Part (b) syms a Fa=exp(-a.^2/2)+2*exp(-(a-3).^2/2)+exp(-(a-6).^2/2) diff(Fa,a) % Part c and d % % Homework 8.1 % Part c and d sigma=0.1; T = 1; N = 1000; run_times = 50; alpha = 0.995; t_small = zeros(1, run_times); for index = 1:run_times x = zeros(1, N + 1); x(1) = 10*randn; for t = 1:N y_t = x(t) + sigma*f_prime_func(x(t)) + sqrt(T*sigma)*randn; rho = min(exp((f_func(y_t) - f_func(x(t)))/T), 1);

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

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

Page1 / 11

STA5107_FRADE_HW7 - STA5107 Dr Srivastava Homework 7 Jaime...

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

View Full Document
Ask a homework question - tutors are online