To perform sensitivity analysis for a neural network in MATLAB, one approach would be to use the MathWorks' Neural Network Toolbox. This toolbox provides functions to create and train neural networks, as well as tools for analyzing their performance.
To perform sensitivity analysis, one could use the toolbox's sensdiff function. This function computes and returns the sensitivities of the network's output with respect to its input, for a given set of input values. The sensdiff function takes the following arguments:
main.m30 chars2 lines
where net is the neural network object, inputs is a matrix of input values for which to compute sensitivities, and errors is a matrix of associated errors.
Here's an example usage of sensdiff:
main.m429 chars13 lines
This will compute the sensitivities of the network's output with respect to its inputs for 5 test input samples, using random error values. The sensitivities will be returned as a matrix of the same size as the input matrix.
Note that the sensitivities calculated by sensdiff are local sensitivities, meaning they approximate the effect of a small perturbation in the inputs around the given values. To obtain more accurate global sensitivities, one could use methods such as Monte Carlo sampling or gradient-based optimization.
gistlibby LogSnag