I'm pretty certain it's a custom algorithm based on the data they keep on you as a consumer. If you did figure out the formula it'd be at least three pages long and only apply to you.
(*cough*). in this context, an algorithm would, by definition, apply to everyone.
i agree that they are allocating surprise points based on their best effort to maximize profits. they are likely trying to figure out what discounts to offer individuals in order to get them to buy stuff to maximize profits, not sales.
dont confuse the two. some companies think that driving sales at all costs will lead to profits. smarter companies realize that there is a magic spot where they are maximizing profits. if they charge less, they will sell more, but make enough less per item that they will have lower profits. if they charge more, they will make more on each sale, but lose total profits from less sales. you see this with gas stations on the opposite sides of divided roads. one will be five cents more per gallon. they know that people will pay it, for what ever reason. they guy on the other side of the median knows that they won't pay that much more on his side.
as an aside, i had a friend in Louisiana who farmed with draft horses. he had 160 acres. all his neighbors had over 1000 acres. he had a few horses, and kept 16 acres for growing their food (hay and grain). he had a bunch of old farm equipment, which he could fix himself. every 5 years or so, he'd pay 100$ to the guy three towns over to get one of this mares bred.
he told me that in the fall, at the "annual grange supper", he would compare notes with the guys who were working 10 or 20 or 30 times as much land as he was. he found out that while he "made" a lot less, he "ended up" with about the same amount, because he didnt have huge payments to John Deere, and the mechanic, and the fuel dealer. he was also paying a lot less for "outside help", cause he had a lot less to do.
like the others, he drive a few year old pickup, and the wife had a sedan. they lived in a nice little house, just like everyone else.
and he got to spend his days talking to the horses, not cursing at the tractor.
returning to the cold technology that surrounds us . . .
having played games balancing networking protocols for maximum throughput, i can tell you that the algorithm for something like this is more than three pages, and is likely approaching not being completely understood by one individual. there is a small group who understand it all, and they likely argue about what effects changes will have, and whomever is wrong ends up buying lunch.
of course, when they are wrong, you find 55$ winton hand sledges on amazon for 18$, with free shipping (as posted on the amazon deals thread before christmas).
big data is a very cool place to play, if you are bent in specific ways. if amazon was smart, they would buy sears when it fire sales, just to use it as a place to fine tune their own algorithms without hurting their own system. hell, for all i know, they already secretly own some small online vendor where they do exactly that.