On Mon, Sep 5, 2011 at 12:25 AM, Yvonnick Noel <yvonnick.n...@uhb.fr> wrote:
> Hi Bill, > > I once modelled a hysteresis phenomenon (on binary data) with a simple > logistic model. I am not sure I understand how this pattern appears in your > data, but in my previous analyses, it appeared as an order effect: The > response increased in probability later with increasing than with decreasing > values of the predictor > Thanks, Yvonnick. You can think of my data as created by a simple thermostat on your home heating system, except in this case the hysteresis band is much broader, about 5 degrees C. As outside temperature rises to an upper threshold, the system eventually enters a high usage state, and that state persists until the outside temperature drops to a lower threshold. That's not quite the problem, but it may paint a good picture of the challenge. I have seen others ignore the hysteresis and model with some nonlinear function (e.g., the GAM I choose or, more likely, some piecewise linear function). That doesn't work badly if the outside temperature swings outside both thresholds daily. If it rises above the upper threshold to enter the high usage state and then drops below the upper threshold but not below the lower threshold for a long period, a simple blending of responses across the two states would seem to fail. For example (and using made-up, dimensionless response units), perhaps the high usage value is 5 * T + 10, while the low usage value is 3 * T + 8 and the thresholds are 5 and 15. If the system passes through each threshold daily, then 6.2 * T - 8 is a decent estimate for temperatures between the thresholds, although the residuals increase between the thresholds. If the temperature passes above 15 and then varies daily between 6 and 26 degrees, the system will remain in a state (5 * T + 10) not well described by 6.2 * T - 8. I wonder if a Markov model could estimate the current state and the response in each state, given the data, and I was looking for a package to make that happen most easily. If the response in each state were linear, that seems straightforward. I have reason to believe the response in one or both states is rather nonlinear by design, though, and I haven't found a (hidden) Markov model package that allows a GAM as the response model. > I then simply created a binary variable for the decreasing and increasing > conditions, and the coefficient on this variable was a direct and testable > measure of hysteresis. > So you created a logistic model that was also sensitive to the prior path or state of the input? I can see that working in some cases, but I have been hoping something like depmixS4 would do the fit to both the transitions and the fit automatically. I think my challenge lies in fitting a GAM or other nonlinear fit (LOESS?) to the responses in each state of that Markov model. > In some cases, you can directly model the bimodal conditional distribution > of the response. This is what I did here with a beta distribution for > continuous bounded responses: > > http://webcolleges.uva.nl/**mediasite/Viewer/?peid=** > c7a7b041327f4db09dc2fc3a7872aa**5a1d<http://webcolleges.uva.nl/mediasite/Viewer/?peid=c7a7b041327f4db09dc2fc3a7872aa5a1d> I'll have to think about that one a bit. I'm not as familiar with this approach, and I sense that it's less directly related to the physical processes in my problem. Still, your slides 20 and 24 show things that seem to correspond to a (hidden) Markov model, so it may prove helpful. I notice that you answered a question about cusp models. I had been wondering about that approach and the cusp package as another alternative. Does my explanation of an analog to the problem suggest other approaches? Merci, Bill [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.