Overview
This prompt aims to guide developers in adding an Auto-Regressive calculator to an existing project while maintaining consistency. Programmers working on time series analysis will benefit from the clear instructions and code examples provided.
Prompt Overview
Purpose: This document outlines the steps to integrate an Auto-Regressive (AR) calculator into the TimeseriesAnalysisProject.
Audience: The intended audience includes developers familiar with Python and the existing TimeseriesAnalysisProject codebase.
Distinctive Feature: The AR calculator will follow the same architectural patterns and coding styles as the existing Moving Average (MA) module.
Outcome: Successfully implementing the AR calculator will enhance the project’s analytical capabilities without introducing new dependencies.
Quick Specs
- Media: Text
- Use case: Generation
- Industry: Development Tools & DevOps, General Business Operations, Productivity & Workflow
- Techniques: Role/Persona Prompting, Self-Critique / Reflection, Structured Output
- Models: Claude 3.5 Sonnet, Gemini 2.0 Flash, GPT-4o, Llama 3.1 70B
- Estimated time: 5-10 minutes
- Skill level: Beginner
Variables to Fill
No inputs required — just copy and use the prompt.
Example Variables Block
No example values needed for this prompt.
The Prompt
Add an AR (Auto-Regressive) calculator module to the existing **TimeseriesAnalysisProject** GitHub repository. Ensure it is implemented in a manner consistent with the existing **MA (Moving Average)** module, without introducing any new dependencies.
Your task is to extend the project by creating an AR calculator that integrates seamlessly with the current codebase, adheres to established coding styles and conventions, and fits into the analysis workflow like the existing MA calculator.
# Steps
1. Review Existing MA Module:
– Examine the current MA calculator code to understand its structure, methods, and integration points.
– Note how input data is handled, parameters are configured, and outputs are generated.
2. Implement AR Calculator Class/Module:
– Implement the AR calculator using the same style and architectural patterns as the MA module.
– Ensure only existing dependencies (likely numpy, pandas, standard libraries) are utilized.
– The AR calculator should accept time series data and compute auto-regressive values based on a specified lag parameter.
3. Integrate AR Calculator:
– Add the AR calculator to the same location(s) in the project where the MA calculator is referenced and invoked.
– Modify or extend any interfaces (e.g., command line options, configuration files) to allow users to select AR calculation, mirroring the selection process for MA.
4. Add Testing/Validation:
– Create or extend unit tests similar to those for MA to verify the accuracy of your AR implementation.
– Test with sample datasets to ensure the AR calculator behaves as expected.
5. Documentation:
– Add comments and docstrings in your AR calculator code consistent with the existing project style.
– Optionally, update the README or related documentation to mention the new AR calculator feature.
# Output Format
Provide detailed step-by-step instructions combined with complete code snippets for the AR calculator and integration changes.
– Code should be clearly commented and formatted to match the existing project style.
# Examples
If the MA calculator class looks like this:
“`python
class MovingAverageCalculator:
def __init__(self, window_size):
self.window_size = window_size
def calculate(self, series):
return series.rolling(window=self.window_size).mean()
“`
Then the AR calculator could be analogous, for example:
“`python
class AutoRegressiveCalculator:
def __init__(self, lag):
self.lag = lag
def calculate(self, series):
# Implementation details here without new dependencies
pass
“`
Replace `pass` with the appropriate AR calculation logic using pandas or numpy.
# Notes
– Do not add any new external libraries.
– Maintain consistency with the existing project structure.
– Assume you have access to current project code for reference and modification.
– Follow best practices for Python coding style and documentation.
Execute the task with clear guidance and code samples enabling the addition of a working AR calculator similar to the MA module in the **TimeseriesAnalysisProject** repository.
Screenshot Examples
How to Use This Prompt
- Copy the prompt provided above.
- Paste the prompt into your preferred coding environment.
- Follow the outlined steps to implement the AR calculator.
- Ensure adherence to existing coding styles and conventions.
- Test the AR calculator thoroughly with sample datasets.
- Document your code and update relevant project documentation.
Tips for Best Results
- Review MA Module: Analyze the existing Moving Average code to understand its structure and how it processes input data, parameters, and outputs.
- Implement AR Calculator: Create an AutoRegressiveCalculator class that mirrors the MA module’s style, using only existing dependencies like numpy and pandas for calculations.
- Integrate AR Module: Add the AR calculator to the project in the same locations as the MA calculator, ensuring users can select it through the same interfaces.
- Add Testing: Develop unit tests for the AR calculator, similar to those for the MA module, to validate its functionality with various datasets.
FAQ
- What is an Auto-Regressive calculator?
An Auto-Regressive calculator predicts future values based on past values in a time series. - How does the AR calculator integrate with the existing project?
It follows the same structure and coding style as the Moving Average module for seamless integration. - What libraries can be used for the AR calculator?
Only existing libraries like numpy and pandas can be used, avoiding new dependencies. - What is the purpose of unit tests for the AR calculator?
Unit tests ensure the accuracy and reliability of the AR calculator's implementation and functionality.
Compliance and Best Practices
- Best Practice: Review AI output for accuracy and relevance before use.
- Privacy: Avoid sharing personal, financial, or confidential data in prompts.
- Platform Policy: Your use of AI tools must comply with their terms and your local laws.
Revision History
- Version 1.0 (February 2026): Initial release.


