phi_sensitivity

phi_sensitivity - % L*x = s x = q*(u \ (l \ (p*s))); %...

This preview shows page 1. Sign up to view the full content.

function [phi, Ws, ss] = phi_sensitivity(W, s) %PHI_SENSITIVITY calculates the mean as well as the partials of phi % See http://mathbin.net/89270 and http://mathbin.net/89286 for full % derivation of the Ws and ss n = size(W, 1); % L* = (L+1) L_star = spdiags((ones(1,n)*W)' + ones(n,1) - diag(W,0), 0, -W); [l u p q] = lu(L_star);
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % L*x = s x = q*(u \ (l \ (p*s))); % dphi/ds = 1/n * (L*' \ ones) ss = (p'*(l' \ (u' \ (q'*ones(n,1)))))/n; % dphi/dwij = (x(j) - x(i))dphi/ds(i) Ws = spdiags(zeros(n,1),0,W); [i,j] = find(Ws); Ws = sparse(i,j,(x(j) - x(i)) .* ss(i)); % phi = dphi/ds dot s phi = sum(x)/n; end...
View Full Document

This note was uploaded on 03/12/2012 for the course CS 3220 taught by Professor Marschner during the Spring '09 term at Cornell.

Ask a homework question - tutors are online