Leader

Showing posts with label Prediction. Show all posts
Showing posts with label Prediction. Show all posts

Saturday, 2 May 2015

Fitting a better psychometric curve (Wichmann and Hill 2001)

Code
GitHub: Matlab code and Python package

Introduction
Psychometric curves quantify the relationship between stimulus parameters and an observer's subjective experience. For an introduction to the concept of psychometric curves in signal analysis theory and a function and instructions to fit a basic curve in Matlab, see Introduction to psychometric curves and fitting a simple psychometric function. This article will focus on fitting a more complex curve with additional parameters that allow for the subjects fallibility, which improves estimation of the key parameter, discrimination sensitivity.

The psychometric function used here is from the paper The psychometric function:I. Fitting, sampling, and goodness of fit, F. Wichmann and N. Hill 2001. This paper, and its companion paper, provide detailed theory and methods for fitting a psychometric function, assessing its goodness of fit, and finding confidence intervals for the ranges of the parameters estimated. This article will demonstrate how to fit Wichmann and Hill's psychometric function in Matlab using the same data from a fictional 2AFC experiment in this post. This will allow an interested reader to make a direct comparison between the Wichmann and Hill curve and the approach using Matlab's glmfit function with a built in binomial distribution and a logit link function.

Friday, 27 February 2015

Simple model fitting: Solar panel profit

Here's an example of how to use Matlab to create a basic predictive model. It'll cover;
  • Choosing an appropriate model based on our current understanding of the system, and what reasonable assumptions we can make about it
  • Using curve fitting to fit the model to the data we already have to refine the coefficients for the model
  • Qualitative and basic quantitative (but not statistical) analysis of the model, and the assumptions made.

The data used will be real income data for a 2.8 kWh solar panel system located in the UK. We have three years worth of data - let's work out how much we can expect to earn over the 25 year period of the original Feed-in Tariff scheme.

The first thing to understand is that all models require assumptions to be made. There has to be logical reason underlying these assumptions, or the model will lack predictive power. Matlab can not do this for you - it can certainly help - but brute force can't replace sensible reasoning.


AdSense