Creating a Model to Predict Animal Behavior


UPDATE (5/18):       Link to Github project repository:

                                                        https://github.com/k-brew/poop_data_scoop

PATENT PENDING - While it had initially occurred to me that I could potentially use this idea/project to perhaps generate some extra money, I decided to make my work open-source and available for general use instead. Considering the idea of this project derivated from the fact that there is discrimination against those with lower income when it comes to pet ownership, I figured that those who would benefit most from such a resource shouldn't have to spend money.

Additionally, with this project being public I hope that the explanations/documentation that I provide of the project workflow and my description of my methods/rationale for designing things the way I did, hopefully, it can serve as a resource for aspiring coders/programmers, it has been allowing me to practice utilizing a wide range of topics that I have learned in pursuit of an M.S. in economics, and the final product will flex my skills/abilities to potential partners in employment - so if you are a potential employer and are reading this, I would recommend that you reach out to me now before my services are demanded and/or occupied elsewhere ;) 

Here's an example of a crude/rough version of the final idea (minus output being covered in text because I'm apparently using a "demo" version)



UPDATE (3/22):

PATENT PENDING - 

Now that enough time has passed to collect a sufficient amount of data and to sort through some ideas, I now have enough content to share about this project. Since the project is still in development, I have not yet been able to add all of the intended functionality to the program, but there is enough that will allow me to utilize it for its initial purposes. There will be additional updates to follow prior to the final release of the product. In the meantime, I thought I would share the developments of my thoughts/approach on this issue.

Not only will this project provide a utility that I will utilize every day, but it will also demonstrate my abilities in data manipulation, transformation, analysis, and coding, but also demonstrates my ability to (1) recognize that a problem exists, (2) robustly consider all angles of the problem and how those angles must be considered in the analysis, and (3) synthesis the various parts of the analytical-process and reach meaningful data-backed conclusions. 

With this research design/paper/product, I hope to provide some economic insight into a topic that is understudied in economic academia. This is just one topic in particular that I chose to analyze in-depth. The flow of ideas that I have are constant. I have an “idea journal” that I keep handy on my phone for recording ideas when inspiration strikes (an economic analysis of my dog's bathroom patterns is just one of those many ideas). I am always eager at new opportunities to apply my past knowledge, skills, and creativity to overcome challenges and approach problems in new ways.

 

Project Overview/Working Paper

Terminology

  • B&B - Bowels/bladder
  • Outing – a trip outside with the dog(s) with the purpose of allowing them to relieve their

Introduction

Anybody who owns a dog while living at a place without a private yard has dealt with their furry companions sometimes whining at sometimes inopportune times wishing to be taken outside.

On one hand, it is important to consider our pets' needs and ensure that they are able to attend to their natural bodily functions and excretory needs. On the other hand, sometimes they whine and indicate that they need to go outside, when they really are just bored and are looking for something to do (and then 30 minutes later start whining again to be taken out again and then actually relieve themselves.

While there certainly are benefits to spending time outside with your pet without the mission being based around them relieving their bowels/bladder (B&B), sometimes life demands things from us that would be easier to deal with if we could have some of that bonding time with our pets perhaps inside where it might be less of a distraction away from life’s other obligations.

For example, if I am a student preparing for a final project or presentation due for a course the next day, taking 4 fifteen-minute outings for each of my dogs over the course of the evening to ensure they have the chance to properly relieve their B&B can present some disruptions into an evening where time might be considered a little more precious than the average evening.

While I want to ensure my dogs have the chance to relieve their B&B as well has have enrichment time, it would be nice to know the difference in what they are needing. Knowing when perhaps giving them a toy and a few minutes of play would satisfy them, or even playing tug with the rope-toy while watching an informative video or lecture recording. That way, I could more easily return to my work without having falsely misinterpreting a whining signal for the need to go outside to relieve their B&B (and spending 20 minutes outside, a few minutes getting dress/undressed for the weather, and then remembering where I was where I left off).

Literature Review

Many people are familiar with the literature that draws the connections between pet ownership and quality of life and anecdotal (and perhaps personal) evidence of the benefits of having a pet companion, but current literature seems to disregard that the cost of pet ownership is discriminatory against people in apartment units or living conditions otherwise where “letting the dog out” can be a lengthy process, more than simply opening the door and letting them run freely in a fenced yard.

I know that I am not the only person who has dealt with some frustrations associated with pet ownership living at an apartment dwelling without a personal yard. While different surveys show different figures, around 60 percent of American households have pets and 42 percent own a dog. According to the American Veterinary Medical Association, more than half of dog-owning households. Looking outside the world of pet ownership, survey data from Pew Research Center confirms that renters tend to have lower levels of income whereas homeowners have higher levels of income.

These figures tell us that there is a large percentage of pet-owning households that have lower levels of income and are more likely to be renters (and therefore also likely facing the same predicament as myself as I had described earlier).

Now that we have established that there is an undiscussed cost of pet ownership that affects a large portion of the dog-owning population of America (and by extension, presumably many other parts of the rest of the world), we can start thinking about solutions.

The Purpose of This Study

The purpose of this project is to create a self-learning model from data on a canine's bathroom habits that can be used to

    (1) predict when the subject canine will need to use the bathroom based on patterns over time and other predictor variables,

    (2) to determine if statistical anomalies can be used to in detecting possible health concerns, and

    (3) to gain a better understanding of our subject canine's habits in relieving their B&B to better understand our pet's and to help minimize the time spent outside because of misinterpreting a signal from our pet

Aggregation of the Data

Once this idea is properly marketed, implemented, and experiences widespread use, the data from pet owner's across the world can be uploaded to a central database (such as one that I host on my website). This macro-data can then be used to help further tune the accuracy/generalizability of the program. 



The Data

Construction of the Data

The data sets that we will be using in this analysis are collected from my two dogs, Buddy and Sparky (to protect their confidentiality, their names have been altered for this study). Buddy is the dog that inspired this study since he likes to whine. Only a fraction of a time, however, does his whining actually signify the need to relieve his B&B a fraction of the time and instead signifies his boredom. As a full-time student and full-time worker, sometimes it would be nice to know if Buddy is whining because he actually needs to go outside, or if he’s just bored and wants to sniff around.

Sparky, on the other hand, much prefers being indoors as opposed to outdoors. Especially on days when it is colder, she is quick with her excretory movements and fast to the door so she can resume lounging on her favorite spot on the couch. Having her data to look at as well will help to improve and validate the strengths of the models we select for predicting the dog’s behaviors.

For this analysis, will be looking at characteristics and trends in successful outings for Buddy so that perhaps we can have some insight and predict when it is likely that Buddy’s whining means he needs to go outside to relieve himself, or if it’s because he is bored and wants some loving.

Methodology

While there is always an issue of unexplained bias in a given model, this project made me realize that it is also very important to account for the human error that might result in skewed results in our interpretation. 

I began this experiment recording data on a piece of paper that hung right next to the door. The logic was that "since I have to go out the door to let the dogs outside, I'll have to pass by this piece of paper every time I let them out and therefore won't forget!". While I was quite good at remembering to record times/data, there would still be times when I would forget some aspects of the data collection, such as forgetting to note their indicator strength, or forgetting to write my time back in after the outing was complete. 

After also dealing with the annoyance of the time spent transcribing the written text to computer format, I decided to automate things with my phone. This way, the data that I input for an outing would be instantly uploaded to the master spreadsheet and would minimize the margin for errors in accuracy (since it is easy to have my phone in my pocket and can update information for the specific outing while outside) and would also minimize the missing values that would plague the data and add to inaccuracy of the model. 

Even after setting things so I could mark entries on my dogs' outings that would instantaneously update the data set, there were still times that I would forget my phone and thus forget to log an outing or times when my phone would be dead and I would forget to enter that time later.

That's when I realized that the problem was, well... me! Not specifically me, but rather the human tendency that exists in all of us to forget things sometimes and not do 100 percent of everything perfectly 100 percent of the time. 

The notion of minimizing the human error component of this process was the inspiration behind configuring a piece of simple hardware to collect such information. Even if my phone was dead or I couldn't find a pen to jot down the time, a piece of hardware on the leash would allow data collection to be as simple as pushing a button to signify the beginning of an "outing", another button to signify the end of an outing and a simple interface that would allow the user to input if the dog relieved their B&B and/or any other notes that would be germane to the nature of the outing.