# Determine maxima and minima of fitted GAMM smooth

I have been using gamm4 to model the daily activity pattern of a certain behavior as a binomial response (whether the behavior occurs or not for each hour of the day). I am comparing the daily activity patterns of two groups (the park they live in). So, for example, one of my models that incorporates the age of each individual is:

gammodel <- gamm4(presentbinary~ age + s(hour, by=park), random =~(1|ID),
data=data, family=binomial)


I would now like to extract from the fitted smooths, the maxima and minimum for the smooths fit for each of the two parks. I would like to know: 1) In each park, at what hour is this behavior most likely to occur? 2) What is the value of that maximum in each park (i.e. what percentage of points occurred at that hour)?

Is there a way to get this information within gamm4? Or do I need to use some other approach? I am also open to using one of the other modeling packages for GAMM if it allows me to extract this information.