Sei sulla pagina 1di 6

Juei-Sheng Chiu - Module 2, Computational Methods (EGRB 215)

Table of Contents

Clean Up

1

Honor Statement

1

Function file - myhill.m

1

Problem 1

1

Clean Up

clear all

close all

clc

Honor Statement

On my honor, I have neither given nor received aid on this assignment, and I pledge that I am in compliance with the VCU Honor System

% signed Joshua Chiu

% Date: 4/9/2015

Function file - myhill.m

type myhill

function [ssr] = myhill(x, C, e_meas)

% x is a two element matrix that contains ec50 and gamma

% c is measured concentration/dose (vector), 'Dose' in drug array

% e_meas is measured response, either response or toxicity in drug array,

% its a vector e_calc = (C.^x(2))./((x(1)^x(2))+C.^x(2)); r = e_meas-e_calc; ssr = sum(r.^2); end

Problem 1

load('Module2_drugdata');

% Use fminsearch to find best fit

param0 = [1, 1]; % initial guess

options = optimset(); store = zeros(7);

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215)

for i=1:7

op = fminsearch(@myhill, param0, options, drug(i).Dose, drug(i).Efficacy); store(i,1) = i; % Sets Drug ID store(i,2) = op(1); store(i,3) = op(2); store(i,4) = myhill(op, drug(i).Dose, drug(i).Efficacy); % SSR for eff y_hate(i, :) = (drug(i).Dose.^op(2))./((op(1)^op(2))+ drug(i).Dose.^op(2));% y_hat for efficacy

op = fminsearch(@myhill, param0, options, drug(i).Dose, drug(i).Toxicity); store(i,5) = op(1); store(i,6) = op(2); store(i,7) = myhill(op, drug(i).Dose, drug(i).Toxicity); % SSR for toxic y_hatt(i, :) = (drug(i).Dose.^op(2))./((op(1)^op(2))+ drug(i).Dose.^op(2));% y_hat for toxicity

figure(i); plot(drug(i).Dose, drug(i).Efficacy, 'or', drug(i).Dose, drug(i).Toxicity, 'bx', drug(i).Dose, y_hate(i, :), 'm', drug(i).Dose, y_hatt(i, :), 'c');

titlestring = ['Drug #:' num2str(i)]; % set a title string based on i title(titlestring); xlabel('Dose'); ylabel('Response'); legend('Efficacy', 'Toxicity'); end

% Determining which drug is 'best'

% I think a 'good' drug should have a very quick rise in efficacy and a

% delayed rise in toxicity. Drug 2 fits this profile exactly - it is

% possible to get a 100% response with very little toxicity. At six or

% seven units, you can get 100% response and almost no toxicity.

% Therefore I recommend drug 2.

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215)

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 3
Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 3

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215)

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 4
Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 4

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215)

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 5
Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) 5

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215)

Juei-Sheng Chiu - Module 2, Com- putational Methods (EGRB 215) Published with MATLAB® 7.12 6

Published with MATLAB® 7.12