input: Write a function to construct a decision tree algorithm for predicting the value of a stock using a csv file containing stock data from the last 3 months. If the file is not found or the data is invalid, return an error message indicating the issue.
  
  def predict_stock_value(csv_file_path):
      try:
          # Load libraries
          import pandas as pd
          import numpy as np
          from sklearn.model_selection import train_test_split
          from sklearn.tree import DecisionTreeClassifier
  
          # Load data
          data = pd.read_csv(csv_file_path)
  
          # Split data
          X = data.iloc[:, :-1].values
          y = data.iloc[:, -1].values
  
          # Train/Test Split
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
  
          # Decision Tree Model
          clf = DecisionTreeClassifier(criterion='entropy', random_state=0)
          clf.fit(X_train, y_train)
  
          # Model Accuracy
          y_pred = clf.predict(X_test)
          return f'Model accuracy: {clf.score(X_test, y_test)}'
      
      except Exception as e:
          return f'Error: {str(e)}'
  
  assert predict_stock_value("stockdata.csv") == "Model accuracy: 1.0"
  assert predict_stock_value("nonexistent.csv") == "Error: [Errno 2] No such file or directory: 'nonexistent.csv'"
  assert predict_stock_value("stockdata_invalid.csv") == "Error: invalid CSV file"
  assert predict_stock_value("stockdata_missing.csv") == "Error: missing required columns"
output: def predict_stock_value(csv_file_path):
      try:
          import pandas as pd
          import numpy as np
          from sklearn.model_selection import train_test_split
          from sklearn.tree import DecisionTreeClassifier
  
          data = pd.read_csv(csv_file_path)
  
          X = data.iloc[:, :-1].values
          y = data.iloc[:, -1].values
  
          X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=0)
  
          clf = DecisionTreeClassifier(criterion='entropy', random_state=0)
          clf.fit(X_train, y_train)
  
          y_pred = clf.predict(X_test)
          return f'Model accuracy: {clf.score(X_test, y_test)}'
      
      except Exception as e:
          return f'Error: {str(e)}'