Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 792357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:58:44+00:00 2026-05-14T21:58:44+00:00

A user visits my website at time t , and they may or may

  • 0

A user visits my website at time t, and they may or may not click on a particular link I care about, if they do I record the fact that they clicked the link, and also the duration since t that they clicked it, call this d.

I need an algorithm that allows me to create a class like this:

class ClickProbabilityEstimate {
    public void reportImpression(long id);
    public void reportClick(long id);

    public double estimateClickProbability(long id);
}

Every impression gets a unique id, and this is used when reporting a click to indicate which impression the click belongs to.

I need an algorithm that will return a probability, based on how much time has past since an impression was reported, that the impression will receive a click, based on how long previous clicks required. Clearly one would expect that this probability will decrease over time if there is still no click.

If necessary, we can set an upper-bound, beyond which we consider the click probability to be 0 (eg. if its been an hour since the impression occurred, we can be pretty sure there won’t be a click).

The algorithm should be both space and time efficient, and hopefully make as few assumptions as possible, while being elegant. Ease of implementation would also be nice. Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T21:58:45+00:00Added an answer on May 14, 2026 at 9:58 pm

    Assuming you keep data on past impressions and clicks, it’s easy: let’s say that you have an impression, and a time d’ has passed since that impression. You can divide your data into three groups:

    1. Impressions which received a click in less than d’
    2. Impressions which received a click after more than d’
    3. Impressions which never received a click

    Clearly the current impression is not in group (1), so eliminate that. You want the probability it is in group (2), which is then

    P = N2 / (N2 + N3)
    

    where N2 is the number of impressions in group 2, and similarly for N3.

    As far as actual implementation, my first thought would be to keep an ordered list of the times d for past impressions which did receive clicks, along with a count of the number of impressions which never received a click, and just do a binary search for d’ in that list. The position you find will give you N1, and then N2 is the length of the list minus N1.

    If you don’t need perfect granularity, you can store the past times as a histogram instead, i.e. a list that contains, in each element list[n], the number of impressions that received a click after at least n but less than n+1 minutes. (Or seconds, or whatever time interval you like) In that case you’d probably want to keep the total number of clicks as a separate variable so you can easily compute N2.

    (By the way, I just made this up, I don’t know if there are standard algorithms for this sort of thing that may be better)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently my database design is not normalised. When a user visits the website all
I need to adjust several views in the event that a user visits my
I'm writing a report that shows total downtime for our website. When a user
Assume browser default settings, and content is sent without expires headers. user visits website,
The first time a user is visiting my website, I am pulling a lot
How would i go about having my site know lets say IE User Visit's
I need to redirect a user to a different page if they visit a
User Controls -- Do they serve a special purpose? As far as I can
I am building a customer-facing website that requires me to build 1) some analytics
Here's the situation. Multi-million user website. Each user's page has a message section. Anyone

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.